mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge #17524: psbt: handle unspendable psbts
773d4572a4Mark PSBTs spending unspendable outputs as invalid in analysis (Andrew Chow)638e40cb60Have a PSBTAnalysis state that indicates invalid PSBT (Andrew Chow) Pull request description: When analyzing an unspendable PSBT, report that it is unspendable and exit analysis early. ACKs for top commit: Sjors: ACK773d457instagibbs: After some thought ACK773d4572a4Tree-SHA512: 99b0cb2fa1ea37593fc65a20effe881639d69ddeeecf5197bc87bc7f2220cbeb40f1d429d517e4d27f2e9fb563a00cd845d2b4b1ce05246a75a6cb56fb9b0ba5
This commit is contained in:
@@ -1674,6 +1674,7 @@ UniValue analyzepsbt(const JSONRPCRequest& request)
|
||||
" \"estimated_feerate\" : feerate (numeric, optional) Estimated feerate of the final signed transaction in " + CURRENCY_UNIT + "/kB. Shown only if all UTXO slots in the PSBT have been filled.\n"
|
||||
" \"fee\" : fee (numeric, optional) The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled.\n"
|
||||
" \"next\" : \"role\" (string) Role of the next person that this psbt needs to go to\n"
|
||||
" \"error\" : \"error\" (string) Error message if there is one"
|
||||
"}\n"
|
||||
},
|
||||
RPCExamples {
|
||||
@@ -1726,7 +1727,7 @@ UniValue analyzepsbt(const JSONRPCRequest& request)
|
||||
}
|
||||
inputs_result.push_back(input_univ);
|
||||
}
|
||||
result.pushKV("inputs", inputs_result);
|
||||
if (!inputs_result.empty()) result.pushKV("inputs", inputs_result);
|
||||
|
||||
if (psbta.estimated_vsize != nullopt) {
|
||||
result.pushKV("estimated_vsize", (int)*psbta.estimated_vsize);
|
||||
@@ -1738,6 +1739,9 @@ UniValue analyzepsbt(const JSONRPCRequest& request)
|
||||
result.pushKV("fee", ValueFromAmount(*psbta.fee));
|
||||
}
|
||||
result.pushKV("next", PSBTRoleName(psbta.next));
|
||||
if (!psbta.error.empty()) {
|
||||
result.pushKV("error", psbta.error);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user