Skip to content

Commit 8b8a1c4

Browse files
committed
Add test for 'mempool min fee not met' rpc error
1 parent c04e0f6 commit 8b8a1c4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/functional/mempool_limit.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,15 @@ def run_test(self):
5050
assert_equal(self.nodes[0].getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))
5151
assert_greater_than(self.nodes[0].getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))
5252

53+
self.log.info('Create a mempool tx that will not pass mempoolminfee')
54+
us0 = utxos.pop()
55+
inputs = [{ "txid" : us0["txid"], "vout" : us0["vout"]}]
56+
outputs = {self.nodes[0].getnewaddress() : 0.0001}
57+
tx = self.nodes[0].createrawtransaction(inputs, outputs)
58+
# specifically fund this tx with a fee < mempoolminfee, >= than minrelaytxfee
59+
txF = self.nodes[0].fundrawtransaction(tx, {'feeRate': relayfee})
60+
txFS = self.nodes[0].signrawtransaction(txF['hex'])
61+
assert_raises_rpc_error(-26, "66: mempool min fee not met", self.nodes[0].sendrawtransaction, txFS['hex'])
62+
5363
if __name__ == '__main__':
5464
MempoolLimitTest().main()

0 commit comments

Comments
 (0)