mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 09:43:55 +02:00
[wallet] abort when attempting to fund a transaction above maxtxfee
FundTransaction calls GetMinimumFee which, when the fee rate is absurdly high, quietly reduced the fee to -maxtxfee. Becaue an absurdly high fee rate is usually the result of a fat finger, aborting seems safer behavior.
This commit is contained in:
@@ -27,6 +27,8 @@ std::string TransactionErrorString(const TransactionError err)
|
||||
return "PSBTs not compatible (different transactions)";
|
||||
case TransactionError::SIGHASH_MISMATCH:
|
||||
return "Specified sighash value does not match existing value";
|
||||
case TransactionError::MAX_FEE_EXCEEDED:
|
||||
return "Fee exceeds maximum configured by -maxtxfee";
|
||||
// no default case, so the compiler can warn about missing cases
|
||||
}
|
||||
assert(false);
|
||||
|
||||
@@ -27,6 +27,7 @@ enum class TransactionError {
|
||||
INVALID_PSBT,
|
||||
PSBT_MISMATCH,
|
||||
SIGHASH_MISMATCH,
|
||||
MAX_FEE_EXCEEDED,
|
||||
};
|
||||
|
||||
std::string TransactionErrorString(const TransactionError error);
|
||||
|
||||
@@ -18,7 +18,6 @@ std::string StringForFeeReason(FeeReason reason) {
|
||||
{FeeReason::PAYTXFEE, "PayTxFee set"},
|
||||
{FeeReason::FALLBACK, "Fallback fee"},
|
||||
{FeeReason::REQUIRED, "Minimum Required Fee"},
|
||||
{FeeReason::MAXTXFEE, "MaxTxFee limit"}
|
||||
};
|
||||
auto reason_string = fee_reason_strings.find(reason);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user