From a4cd1d6423ca57cae4b1f81abab4a85a61edd9ba Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 1 Oct 2024 21:11:47 +0300 Subject: [PATCH] fix: explicitly test no tx in mempool after invalidateblock --- test/functional/feature_dip0020_activation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/functional/feature_dip0020_activation.py b/test/functional/feature_dip0020_activation.py index 4e5fb2280e..4a7b3e50af 100755 --- a/test/functional/feature_dip0020_activation.py +++ b/test/functional/feature_dip0020_activation.py @@ -68,6 +68,7 @@ class DIP0020ActivationTest(BitcoinTestFramework): tx0.vout.append(CTxOut(value, CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE]))) tx0.rehash() tx0_hex = tx0.serialize().hex() + tx0id = node.decoderawtransaction(tx0_hex)["txid"] # flush state to disk before potential crashes below self.nodes[0].gettxoutsetinfo() @@ -118,10 +119,11 @@ class DIP0020ActivationTest(BitcoinTestFramework): node.invalidateblock(node.getbestblockhash()) except: self.start_node(0) + assert tx0id not in set(node.getrawmempool()) node.generate(1) self.log.info("Transactions spending coins with new opcodes are accepted one block after DIP0020 activation block") - tx0id = node.sendrawtransaction(tx0_hex) + node.sendrawtransaction(tx0_hex) assert tx0id in set(node.getrawmempool())