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.