File tree 1 file changed +9
-11
lines changed
1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -111,23 +111,21 @@ def test_reorg(self):
111
111
senttx = self .nodes [2 ].sendtoaddress (self .nodes [0 ].getnewaddress (), 1 )
112
112
113
113
# generate on both sides
114
- lastblockhash = self .nodes [1 ].generate (6 )[5 ]
115
- self .nodes [2 ].generate (7 )
116
- self .log .debug ('lastblockhash={}' .format (lastblockhash ))
114
+ nodes1_last_blockhash = self .nodes [1 ].generate (6 )[- 1 ]
115
+ nodes2_first_blockhash = self .nodes [2 ].generate (7 )[0 ]
116
+ self .log .debug ("nodes[1] last blockhash = {}" .format (nodes1_last_blockhash ))
117
+ self .log .debug ("nodes[2] first blockhash = {}" .format (nodes2_first_blockhash ))
117
118
118
119
self .sync_all (self .nodes [:2 ])
119
120
self .sync_all (self .nodes [2 :])
120
121
121
122
self .join_network ()
122
123
123
- # listsinceblock(lastblockhash) should now include tx, as seen from nodes[0]
124
- lsbres = self .nodes [0 ].listsinceblock (lastblockhash )
125
- found = False
126
- for tx in lsbres ['transactions' ]:
127
- if tx ['txid' ] == senttx :
128
- found = True
129
- break
130
- assert found
124
+ # listsinceblock(nodes1_last_blockhash) should now include tx as seen from nodes[0]
125
+ # and return the block height which listsinceblock now exposes since a5e7795.
126
+ transactions = self .nodes [0 ].listsinceblock (nodes1_last_blockhash )['transactions' ]
127
+ found = next (tx for tx in transactions if tx ['txid' ] == senttx )
128
+ assert_equal (found ['blockheight' ], self .nodes [0 ].getblockheader (nodes2_first_blockhash )['height' ])
131
129
132
130
def test_double_spend (self ):
133
131
'''
You can’t perform that action at this time.
0 commit comments