fix: minor fixes

This commit is contained in:
Byron Hambly 2026-06-24 14:22:57 +02:00
parent 6435e06408
commit fe648bc6f5
No known key found for this signature in database
GPG key ID: DE8F6EA20A661697
3 changed files with 4 additions and 3 deletions

View file

@ -26,10 +26,8 @@ static bool CheckProofGeneric(const CBlockHeader& block, const uint32_t max_bloc
// Check signature limits for blocks
if (scriptSig.size() > max_block_signature_size) {
assert(!is_dyna);
return false;
} else if (witness.GetSerializedSize() > max_block_signature_size) {
assert(is_dyna);
return false;
}

View file

@ -552,7 +552,7 @@ bool DecomposePeginWitness(const CScriptWitness& witness, CAmount& value, CAsset
{
const auto& stack = witness.stack;
if (stack.size() < 5) return false;
if (stack.size() != 6) return false;
CDataStream stream(stack[0], SER_NETWORK, PROTOCOL_VERSION);
stream >> value;

View file

@ -1376,6 +1376,9 @@ RPCHelpMan blindrawtransaction()
// Vacuous, just return the transaction
return EncodeHexTx(CTransaction(tx));
} else if (n_blinded_ins > 0 && num_pubkeys == 0) {
if (tx.vout.empty()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Unable to blind transaction: transaction has no outputs to balance blinded inputs against.");
}
// Blinded inputs need to balanced with something to be valid, make a dummy.
CTxOut newTxOut(tx.vout.back().nAsset.GetAsset(), 0, CScript() << OP_RETURN);
tx.vout.push_back(newTxOut);