#35429 wallet: avoid global access in external signer SPKM
https://github.com/bitcoin/bitcoin/pull/35429 · · +55/-27 in 5 files, 2 commits · labels: Wallet, Needs rebase
Goal
- Improve wallet modularity by eliminating direct calls to global state in external signer handling
This PR refactors `ExternalSignerScriptPubKeyMan` to remove its direct calls to `gArgs` and `Params()`. The external signer command string and chain type are instead captured once in `CWallet::LoadWalletArgs`, stored on the `CWallet` instance, and passed into `ExternalSignerScriptPubKeyMan` during initialization.
Problem: `ExternalSignerScriptPubKeyMan::GetExternalSigner()` reached into global state (`gArgs` and `Params()`) deep inside wallet execution paths, hindering modularity and decoupling of the wallet engine.
Category: Wallet (#76 of 84)
P4 · cleanup
- P4 because it is an internal cleanup with no user-visible behavior change
- It incrementally decouples wallet components but does not unblock critical roadmap items
This is an internal refactoring that removes global variable access from the external signer manager without changing functionality. As stated in the commit message, there is 'No behavior change' and it is not tied to any critical roadmap item or bug fix.
Membership: Modifies external signer scriptPubKeyMan initialization and CWallet argument loading in src/wallet/.
Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 1
Reviewability: Stale: Needs rebase
- Needs rebase due to merge conflicts
- Author has been inactive for several months
The PR has merge conflicts with current master and the author has been silent for over 100 days.
Author status: silent since 2026-06-01
Agreement: Crickets
- No concept or code reviews yet
- Only an administrative ping requesting a rebase (sedited)
No concept or code reviews yet; only an administrative rebase request from sedited.
Nobody has evaluated or commented on the PR contents apart from a rebase reminder.
- sedited pinged the author for a rebase on 2026-09-17
Review verdicts (DrahtBot): 0
Files
11 lines under test/bench/ci.
- src/wallet/external_signer_scriptpubkeyman.h +22/-13
- src/wallet/external_signer_scriptpubkeyman.cpp +8/-10
- src/wallet/wallet.cpp +9/-4
- src/wallet/test/scriptpubkeyman_tests.cpp +11/-0
- src/wallet/wallet.h +5/-0
Card
This PR refactors ExternalSignerScriptPubKeyMan to take the external signer command and chain identifier as parameters from CWallet rather than reading gArgs and Params() directly. It is an internal architectural cleanup that eliminates global state access from the wallet's external signer manager with no behavior change. The PR has had no reviews, is currently conflicted with master, and the author has been inactive for over three months.