Repository navigation
Conversation
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
This was referenced Aug 26, 2026
Contributor
|
Ping for rebase @w0xlt |
Contributor
|
Are you still working on this? |
ExternalSignerScriptPubKeyMan::GetExternalSigner() reached into global state (gArgs for -signer, Params() for the chain type) from deep inside the signing and descriptor-setup paths. Capture both in LoadWalletArgs -- where the wallet already reads its other settings from the injected WalletContext -- store them on CWallet, and pass them to ExternalSignerScriptPubKeyMan through its LoadFromStorage() and CreateNew() factories. GetExternalSigner() now takes the command and chain as parameters. When -signer is unset the command is empty and the same "restart bitcoind with -signer" error is returned. The chain string comes from the same ArgsManager that Params() is selected from at startup. -signer is now read when the wallet is loaded rather than each time a signer is used, so a value changed at runtime (e.g. via the GUI options dialog, which already requires a restart) only applies to wallets loaded afterwards. This matches the other wallet options read in LoadWalletArgs.
Add unit tests asserting that: - GetExternalSigner() with an empty command returns the "needs -signer" error before any external process is launched. - LoadWalletArgs captures -signer and the chain from the wallet's injected ArgsManager. The chain is set to differ from the global Params(), so reading it from globals would fail the test. In wallet_signer.py, check the debug log when spending from a wallet loaded with a disconnected signer. A missing signer and an empty -signer command both surface as the same "External signer not found" RPC error, so the log message is what shows that the configured command reached the loaded wallet's ScriptPubKeyMan.
w0xlt
force-pushed
the
wallet-external-signer-no-globals
branch
from
November 2, 2026 21:29
c0dc4d5 to
d28c185
Compare
Contributor
Author
|
@sedited Still on it, thanks for the ping! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR removes direct access to process-wide state from
ExternalSignerScriptPubKeyMan.Instead of reading
gArgs/Params()from theSPKM, the wallet load/setup path now reads the external signer command and chain once, stores them onCWallet, and passes the narrow values into the external signer SPKM.This keeps argument and chain selection at the wallet boundary and makes the SPKM less coupled to global state.