Merge a926d6dfd2 into merged_master (Bitcoin PR bitcoin/bitcoin#22310)

This commit is contained in:
Andrew Poelstra 2021-07-30 12:39:04 +00:00
commit dbd482d595

View file

@ -129,6 +129,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):
@ -641,6 +644,16 @@ 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 = CTxOutValue(tx.vout[0].nValue.getAmount() - 1)
tx.vout[1].nValue = CTxOutValue(tx.vout[1].nValue.getAmount() + 1)
assert_raises_rpc_error(-26, "insufficient fee", self.nodes[0].sendrawtransaction, tx.serialize().hex())
if __name__ == '__main__':
ReplaceByFeeTest().main()