Restrict joinpsbts to PSBTv0 only

This commit is contained in:
Ava Chow 2024-07-22 17:14:48 -04:00
parent e79474e561
commit 29c3fb76ef

View file

@ -1900,6 +1900,9 @@ static RPCHelpMan joinpsbts()
if (!DecodeBase64PSBT(psbtx, txs[i].get_str(), error)) {
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, strprintf("TX decode failed %s", error));
}
if (psbtx.GetVersion() != 0) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "joinpsbts only operates on version 0 PSBTs");
}
psbtxs.push_back(psbtx);
// Choose the highest version number
if (*psbtx.tx_version > best_version) {