diff --git a/src/common/messages.cpp b/src/common/messages.cpp index 5fe3e9e4d86..fc0b4a8861f 100644 --- a/src/common/messages.cpp +++ b/src/common/messages.cpp @@ -116,6 +116,10 @@ bilingual_str PSBTErrorString(PSBTError err) return Untranslated("External signer failed to sign"); case PSBTError::UNSUPPORTED: return Untranslated("Signer does not support PSBT"); + case PSBTError::INCOMPLETE: + return Untranslated("Input needs additional signatures or other data"); + case PSBTError::OK: + return Untranslated("No errors"); // no default case, so the compiler can warn about missing cases } assert(false); diff --git a/src/common/types.h b/src/common/types.h index 0d9cb67ce94..fb9ee4bf31b 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -20,6 +20,8 @@ enum class PSBTError { EXTERNAL_SIGNER_NOT_FOUND, EXTERNAL_SIGNER_FAILED, UNSUPPORTED, + INCOMPLETE, + OK, }; } // namespace common diff --git a/src/node/psbt.cpp b/src/node/psbt.cpp index 51e252bffca..079c7e2d4e2 100644 --- a/src/node/psbt.cpp +++ b/src/node/psbt.cpp @@ -64,7 +64,7 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx) // Figure out what is missing SignatureData outdata; - bool complete = SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, &txdata, 1, &outdata); + bool complete = SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, &txdata, 1, &outdata) == PSBTError::OK; // Things are missing if (!complete) { @@ -124,7 +124,7 @@ PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx) PSBTInput& input = psbtx.inputs[i]; Coin newcoin; - if (!SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, nullptr, 1) || !psbtx.GetInputUTXO(newcoin.out, i)) { + if (SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, nullptr, 1) != PSBTError::OK || !psbtx.GetInputUTXO(newcoin.out, i)) { success = false; break; } else { diff --git a/src/psbt.cpp b/src/psbt.cpp index 9369cfc334d..c89066c1497 100644 --- a/src/psbt.cpp +++ b/src/psbt.cpp @@ -4,12 +4,15 @@ #include +#include #include #include #include