mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
sendall: check if the maxtxfee has been exceeded
This commit is contained in:
@@ -1402,6 +1402,10 @@ RPCHelpMan sendall()
|
||||
const CAmount fee_from_size{fee_rate.GetFee(tx_size.vsize)};
|
||||
const CAmount effective_value{total_input_value - fee_from_size};
|
||||
|
||||
if (fee_from_size > pwallet->m_default_max_tx_fee) {
|
||||
throw JSONRPCError(RPC_WALLET_ERROR, TransactionErrorString(TransactionError::MAX_FEE_EXCEEDED).original);
|
||||
}
|
||||
|
||||
if (effective_value <= 0) {
|
||||
if (send_max) {
|
||||
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Total value of UTXO pool too low to pay for transaction, try using lower feerate.");
|
||||
|
||||
Reference in New Issue
Block a user