Skip to content

Commit 0a4ee93

Browse files
committed
wallet: use PSBTError::EXTERNAL_SIGNER_NOT_FOUND
Instead of throwing a runtime error, let the caller decide how to handle a missing signer. GUI code was already in place to handle this, but it was unused until this commit. Fixes #32426 Additionally use LogWarning instead of std::cerr.
1 parent 8ba2f9b commit 0a4ee93

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/wallet/external_signer_scriptpubkeyman.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,14 @@ std::optional<PSBTError> ExternalSignerScriptPubKeyMan::FillPSBT(PartiallySigned
9494
if (complete) return {};
9595

9696
auto signer{GetExternalSigner()};
97-
if (!signer) throw std::runtime_error(util::ErrorString(signer).original);
97+
if (!signer) {
98+
LogWarning("%s", util::ErrorString(signer).original);
99+
return PSBTError::EXTERNAL_SIGNER_NOT_FOUND;
100+
}
98101

99102
std::string failure_reason;
100103
if(!signer->SignTransaction(psbt, failure_reason)) {
101-
tfm::format(std::cerr, "Failed to sign: %s\n", failure_reason);
104+
LogWarning("Failed to sign: %s\n", failure_reason);
102105
return PSBTError::EXTERNAL_SIGNER_FAILED;
103106
}
104107
if (finalize) FinalizePSBT(psbt); // This won't work in a multisig setup

0 commit comments

Comments
 (0)