3 minor findings · 2 suggestions
Findings
[minor] · Signing RPCs misclassify external-signer command failures
For an incomplete PSBT in an external-signer wallet, subprocess or JSON failures during signing now return RPC_INTERNAL_ERROR (-32603) instead of RPC_MISC_ERROR (-1).
Location: src/rpc/server.cpp:893 (head).
Details and suggested fix
send, sendall, walletprocesspsbt with signing enabled, and bumpfee reach ExternalSignerScriptPubKeyMan::FillPSBT without catching signer exceptions. A nonzero exit or malformed JSON from enumerate propagates as ExternalSignerError. If enumeration succeeds and an input fingerprint matches, the same failure from signtx propagates as plain std::runtime_error. Both reach the changed generic handler, so expected device or configuration failures are categorized as internal bugs. Empty enumeration and structured signtx error responses still use the existing returned-error paths. These exceptions occur before transaction commit; only the error category changes. Wrap SignTransaction's RunCommandParseJSON call in ExternalSignerError, as the other signer methods do, and translate that exception to RPC_MISC_ERROR before the generic std::exception handler.
[minor] · GUI address display loses translated signer errors
In the single-process GUI, signer-response validation failures now discard available translations and replace the “Signer error” warning with an English-only critical dialog.
Location: src/wallet/external_signer_scriptpubkeyman.cpp:75 (head).
Details and suggested fix
When the signer returns an error string, omits the address, or echoes a different address, these branches now throw ExternalSignerError containing only .original. The wallet interface forwards that exception to WalletModel::displayAddress, which displays e.what() in the critical “Can't display address” dialog. Previously, the bilingual util::Error reached the warning branch, which uses .translated. Keep returning util::Error for these three response-validation failures. walletdisplayaddress already converts failed results to RPC_MISC_ERROR, so this preserves its error code while retaining translated GUI feedback.
[minor] · dumptxoutset write failures and close failures return different codes
A short write during snapshot serialization now makes dumptxoutset return -32603, while a failure detected at close still returns -1, categorizing the same output-device failure differently.
Location: src/rpc/blockchain.cpp:3467 (head).
Details and suggested fix
WriteUTXOSnapshot serializes metadata and coins through AutoFile, whose write method throws std::ios_base::failure on a short fwrite, for example when the output filesystem fills up. That exception escapes to the changed generic RPC handler instead of reaching this explicit close-error translation. At base, both failures returned -1. Output-path failures from fs::status, fs::rename, and the rollback directory's fs::create_directories also escape as filesystem exceptions. Translate snapshot-output std::ios_base::failure and output-path fs::filesystem_error to RPC_MISC_ERROR, while leaving the coin-count CHECK_NONFATAL consistency failure on the internal-error path.
Optional improvements
[suggestion] · Generate RPCs still classify expected template failures as internal errors
For the mocktime-induced time-too-new condition, the test-oriented generate RPCs now return -32603 rather than -1, although getblocktemplate preserves -1 for the same expected template-creation failure.
Location: src/rpc/mining.cpp:913 (head).
Details and suggested fix
generatetoaddress and generatetodescriptor call CreateNewTemplate through generateBlocks; generateblock calls it directly. All retain the default validity check, so BlockAssembler can throw before any later RPC-specific validation runs. The timestamp setup in interface_ipc_mining.py illustrates the trigger: six accepted blocks at the node's future-time limit force the next template beyond that limit until local time advances by one second. The changed generic handler now categorizes this expected failure as internal. Factor the new CreateNewTemplate exception translation into a small RPC helper and use it at all three call sites to preserve consistent error codes.
[suggestion] · Client-visible RPC error-code changes have no release note
RPC clients that match numeric error codes receive several undocumented compatibility changes, including the generic exception fallback moving from -1 to -32603.
Location: src/rpc/server.cpp:893 (head).
Details and suggested fix
Add an RPC release note listing the changed mappings: integer conversion failures from -1 to -3; invalid addnode/setban commands and out-of-range mockscheduler intervals from -1 to -8; disabled fee estimation and the coinstats-index syncing error from -32603 to -1; and otherwise unhandled standard exceptions from -1 to -32603. Clients branching on these codes need this information even though the requests still fail. doc/developer-notes.md requests release notes for API changes, and doc/release-notes-34861.md provides an existing error-code example.