mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
wallet: fix sendall creates tx that fails tx-size check
The `sendall` RPC doesn't use `CreateTransactionInternal`as the rest of the wallet RPCs and it never checks against the tx-size mempool limit. Add a check for tx-size as well as test coverage for that case.
This commit is contained in:
@@ -1414,6 +1414,11 @@ RPCHelpMan sendall()
|
||||
}
|
||||
}
|
||||
|
||||
// If this transaction is too large, e.g. because the wallet has many UTXOs, it will be rejected by the node's mempool.
|
||||
if (tx_size.weight > MAX_STANDARD_TX_WEIGHT) {
|
||||
throw JSONRPCError(RPC_WALLET_ERROR, "Transaction too large.");
|
||||
}
|
||||
|
||||
CAmount output_amounts_claimed{0};
|
||||
for (const CTxOut& out : rawTx.vout) {
|
||||
output_amounts_claimed += out.nValue;
|
||||
|
||||
Reference in New Issue
Block a user