16
16
class MempoolCoinbaseTest (BitcoinTestFramework ):
17
17
def set_test_params (self ):
18
18
self .num_nodes = 2
19
+ self .extra_args = [
20
+ [
21
+ '[email protected] ' ,
# immediate tx relay
22
+ ],
23
+ []
24
+ ]
19
25
20
26
def skip_test_if_missing_module (self ):
21
27
self .skip_if_no_wallet ()
@@ -38,8 +44,8 @@ def run_test(self):
38
44
# 3. Indirect (coinbase and child both in chain) : spend_103 and spend_103_1
39
45
# Use invalidatblock to make all of the above coinbase spends invalid (immature coinbase),
40
46
# and make sure the mempool code behaves correctly.
41
- b = [ self .nodes [0 ].getblockhash (n ) for n in range (101 , 105 ) ]
42
- coinbase_txids = [ self .nodes [0 ].getblock (h )['tx' ][0 ] for h in b ]
47
+ b = [self .nodes [0 ].getblockhash (n ) for n in range (101 , 105 )]
48
+ coinbase_txids = [self .nodes [0 ].getblock (h )['tx' ][0 ] for h in b ]
43
49
spend_101_raw = create_raw_transaction (self .nodes [0 ], coinbase_txids [1 ], node1_address , amount = 49.99 )
44
50
spend_102_raw = create_raw_transaction (self .nodes [0 ], coinbase_txids [2 ], node0_address , amount = 49.99 )
45
51
spend_103_raw = create_raw_transaction (self .nodes [0 ], coinbase_txids [3 ], node0_address , amount = 49.99 )
@@ -67,6 +73,10 @@ def run_test(self):
67
73
# Broadcast and mine 103_1:
68
74
spend_103_1_id = self .nodes [0 ].sendrawtransaction (spend_103_1_raw )
69
75
last_block = self .nodes [0 ].generate (1 )
76
+ # Sync blocks, so that peer 1 gets the block before timelock_tx
77
+ # Otherwise, peer 1 would put the timelock_tx in recentRejects
78
+ self .sync_all ()
79
+
70
80
# Time-locked transaction can now be spent
71
81
timelock_tx_id = self .nodes [0 ].sendrawtransaction (timelock_tx )
72
82
0 commit comments