mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-05 14:18:48 +02:00
[rpc/node] check for high fee before ATMP in clients
Check absurd fee in BroadcastTransaction and RPC, return TransactionError::MAX_FEE_EXCEEDED instead of TxValidationResult::TX_NOT_STANDARD because this is client preference, not a node-wide policy.
This commit is contained in:
@@ -456,9 +456,9 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||
# Thus, testmempoolaccept should reject
|
||||
testres = self.nodes[2].testmempoolaccept([rawTxSigned['hex']], 0.00001000)[0]
|
||||
assert_equal(testres['allowed'], False)
|
||||
assert_equal(testres['reject-reason'], 'absurdly-high-fee')
|
||||
assert_equal(testres['reject-reason'], 'max-fee-exceeded')
|
||||
# and sendrawtransaction should throw
|
||||
assert_raises_rpc_error(-26, "absurdly-high-fee", self.nodes[2].sendrawtransaction, rawTxSigned['hex'], 0.00001000)
|
||||
assert_raises_rpc_error(-25, 'Fee exceeds maximum configured by -maxtxfee', self.nodes[2].sendrawtransaction, rawTxSigned['hex'], 0.00001000)
|
||||
# and the following calls should both succeed
|
||||
testres = self.nodes[2].testmempoolaccept(rawtxs=[rawTxSigned['hex']])[0]
|
||||
assert_equal(testres['allowed'], True)
|
||||
@@ -480,9 +480,9 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||
# Thus, testmempoolaccept should reject
|
||||
testres = self.nodes[2].testmempoolaccept([rawTxSigned['hex']])[0]
|
||||
assert_equal(testres['allowed'], False)
|
||||
assert_equal(testres['reject-reason'], 'absurdly-high-fee')
|
||||
assert_equal(testres['reject-reason'], 'max-fee-exceeded')
|
||||
# and sendrawtransaction should throw
|
||||
assert_raises_rpc_error(-26, "absurdly-high-fee", self.nodes[2].sendrawtransaction, rawTxSigned['hex'])
|
||||
assert_raises_rpc_error(-25, 'Fee exceeds maximum configured by -maxtxfee', self.nodes[2].sendrawtransaction, rawTxSigned['hex'])
|
||||
# and the following calls should both succeed
|
||||
testres = self.nodes[2].testmempoolaccept(rawtxs=[rawTxSigned['hex']], maxfeerate='0.20000000')[0]
|
||||
assert_equal(testres['allowed'], True)
|
||||
|
Reference in New Issue
Block a user