File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ def set_test_params(self):
72
72
["-mempoolreplacement=0" ]]
73
73
74
74
def run_test (self ):
75
+ # Leave IBD and ensure nodes are synced
76
+ self .nodes [0 ].generate (1 )
77
+ self .sync_all ()
78
+
75
79
make_utxo (self .nodes [0 ], 1 * COIN )
76
80
77
81
self .log .info ("Running test simple doublespend..." )
@@ -110,13 +114,18 @@ def test_simple_doublespend(self):
110
114
"""Simple doublespend"""
111
115
tx0_outpoint = make_utxo (self .nodes [0 ], int (1.1 * COIN ))
112
116
117
+ # make_utxo may have generated a bunch of blocks, so we need to sync
118
+ # before we can spend the coins generated, or else the resulting
119
+ # transactions might not be accepted by our peers.
120
+ self .sync_all ()
121
+
113
122
tx1a = CTransaction ()
114
123
tx1a .vin = [CTxIn (tx0_outpoint , nSequence = 0 )]
115
124
tx1a .vout = [CTxOut (1 * COIN , CScript ([b'a' ]))]
116
125
tx1a_hex = txToHex (tx1a )
117
126
tx1a_txid = self .nodes [0 ].sendrawtransaction (tx1a_hex , True )
118
127
119
- self .sync_all ([ self . nodes ] )
128
+ self .sync_all ()
120
129
121
130
# Should fail because we haven't changed the fee
122
131
tx1b = CTransaction ()
You can’t perform that action at this time.
0 commit comments