Skip to content

Commit c4ddee6

Browse files
committed
test: Add test for replacement relay fee check
1 parent b2f5c38 commit c4ddee6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/functional/feature_rbf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ def run_test(self):
122122
self.log.info("Running test no inherited signaling...")
123123
self.test_no_inherited_signaling()
124124

125+
self.log.info("Running test replacement relay fee...")
126+
self.test_replacement_relay_fee()
127+
125128
self.log.info("Passed")
126129

127130
def test_simple_doublespend(self):
@@ -627,6 +630,15 @@ def test_no_inherited_signaling(self):
627630
assert_equal(True, self.nodes[0].getmempoolentry(optin_parent_tx['txid'])['bip125-replaceable'])
628631
assert_raises_rpc_error(-26, 'txn-mempool-conflict', self.nodes[0].sendrawtransaction, replacement_child_tx["hex"], 0)
629632

633+
def test_replacement_relay_fee(self):
634+
wallet = MiniWallet(self.nodes[0])
635+
wallet.scan_blocks(start=77, num=1)
636+
tx = wallet.send_self_transfer(from_node=self.nodes[0])['tx']
637+
638+
# Higher fee, higher feerate, different txid, but the replacement does not provide a relay
639+
# fee conforming to node's `incrementalrelayfee` policy of 1000 sat per KB.
640+
tx.vout[0].nValue -= 1
641+
assert_raises_rpc_error(-26, "insufficient fee", self.nodes[0].sendrawtransaction, tx.serialize().hex())
630642

631643
if __name__ == '__main__':
632644
ReplaceByFeeTest().main()

0 commit comments

Comments
 (0)