mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-27 18:21:34 +02:00
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.
This commit is contained in:
@@ -94,11 +94,14 @@ std::optional<PSBTError> ExternalSignerScriptPubKeyMan::FillPSBT(PartiallySigned
|
||||
if (complete) return {};
|
||||
|
||||
auto signer{GetExternalSigner()};
|
||||
if (!signer) throw std::runtime_error(util::ErrorString(signer).original);
|
||||
if (!signer) {
|
||||
LogWarning("%s", util::ErrorString(signer).original);
|
||||
return PSBTError::EXTERNAL_SIGNER_NOT_FOUND;
|
||||
}
|
||||
|
||||
std::string failure_reason;
|
||||
if(!signer->SignTransaction(psbt, failure_reason)) {
|
||||
tfm::format(std::cerr, "Failed to sign: %s\n", failure_reason);
|
||||
LogWarning("Failed to sign: %s\n", failure_reason);
|
||||
return PSBTError::EXTERNAL_SIGNER_FAILED;
|
||||
}
|
||||
if (finalize) FinalizePSBT(psbt); // This won't work in a multisig setup
|
||||
|
Reference in New Issue
Block a user