diff options
author | ishaanam <ishaana.misra@gmail.com> | 2022-09-13 17:24:03 -0400 |
---|---|---|
committer | ishaanam <ishaana.misra@gmail.com> | 2022-09-13 18:12:42 -0400 |
commit | 6f8e3818af7585b961039bf0c768be2e4ee44e0f (patch) | |
tree | 29b662e297dc23a7a70e9e5d07bfc7436436afb5 /src/wallet | |
parent | 29d540b7ada890dd588c4825d40c27c5e6f20061 (diff) |
sendall: check if the maxtxfee has been exceeded
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/rpc/spend.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/rpc/spend.cpp b/src/wallet/rpc/spend.cpp index 7eefa76a3e..88630340bc 100644 --- a/src/wallet/rpc/spend.cpp +++ b/src/wallet/rpc/spend.cpp @@ -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."); |