diff options
author | Antoine Riard <dev@ariard.me> | 2021-06-22 13:08:55 -0400 |
---|---|---|
committer | Antoine Riard <dev@ariard.me> | 2021-06-30 18:47:08 -0400 |
commit | c4ddee64c7f80eee05a95116ef1b1dc8a7601183 (patch) | |
tree | 6286b7d772e125a9d0ee9c9cdc282c0133d5b21d /test | |
parent | b2f5c38333fd2ec03fd1299a1bce507b25753f45 (diff) |
test: Add test for replacement relay fee check
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/feature_rbf.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/feature_rbf.py b/test/functional/feature_rbf.py index e42f8045db..ed944274e3 100755 --- a/test/functional/feature_rbf.py +++ b/test/functional/feature_rbf.py @@ -122,6 +122,9 @@ class ReplaceByFeeTest(BitcoinTestFramework): self.log.info("Running test no inherited signaling...") self.test_no_inherited_signaling() + self.log.info("Running test replacement relay fee...") + self.test_replacement_relay_fee() + self.log.info("Passed") def test_simple_doublespend(self): @@ -627,6 +630,15 @@ class ReplaceByFeeTest(BitcoinTestFramework): assert_equal(True, self.nodes[0].getmempoolentry(optin_parent_tx['txid'])['bip125-replaceable']) assert_raises_rpc_error(-26, 'txn-mempool-conflict', self.nodes[0].sendrawtransaction, replacement_child_tx["hex"], 0) + def test_replacement_relay_fee(self): + wallet = MiniWallet(self.nodes[0]) + wallet.scan_blocks(start=77, num=1) + tx = wallet.send_self_transfer(from_node=self.nodes[0])['tx'] + + # Higher fee, higher feerate, different txid, but the replacement does not provide a relay + # fee conforming to node's `incrementalrelayfee` policy of 1000 sat per KB. + tx.vout[0].nValue -= 1 + assert_raises_rpc_error(-26, "insufficient fee", self.nodes[0].sendrawtransaction, tx.serialize().hex()) if __name__ == '__main__': ReplaceByFeeTest().main() |