@@ -176,7 +176,7 @@ enum ForkStep {
176
176
/// `prev_header` as its tip. There is no ordering guarantee between different ForkStep types, but
177
177
/// `DisconnectBlock` and `ConnectBlock` are each returned in height-descending order.
178
178
async fn find_fork ( current_header : BlockHeaderData , prev_header : & BlockHeaderData , block_source : & mut dyn BlockSource , cache : & HeaderCache , mainnet : bool ) -> BlockSourceResult < Vec < ForkStep > > {
179
- let mut steps_tx = Vec :: new ( ) ;
179
+ let mut steps = Vec :: new ( ) ;
180
180
let mut current = current_header;
181
181
let mut previous = * prev_header;
182
182
loop {
@@ -188,16 +188,16 @@ async fn find_fork(current_header: BlockHeaderData, prev_header: &BlockHeaderDat
188
188
// Found the parent block.
189
189
if current. height - 1 == previous. height &&
190
190
current. header . prev_blockhash == previous. header . block_hash ( ) {
191
- steps_tx . push ( ForkStep :: ConnectBlock ( current) ) ;
191
+ steps . push ( ForkStep :: ConnectBlock ( current) ) ;
192
192
break ;
193
193
}
194
194
195
195
// Found a chain fork.
196
196
if current. header . prev_blockhash == previous. header . prev_blockhash {
197
197
let fork_point = look_up_prev_header ( block_source, & previous, cache, mainnet) . await ?;
198
- steps_tx . push ( ForkStep :: DisconnectBlock ( previous) ) ;
199
- steps_tx . push ( ForkStep :: ConnectBlock ( current) ) ;
200
- steps_tx . push ( ForkStep :: ForkPoint ( fork_point) ) ;
198
+ steps . push ( ForkStep :: DisconnectBlock ( previous) ) ;
199
+ steps . push ( ForkStep :: ConnectBlock ( current) ) ;
200
+ steps . push ( ForkStep :: ForkPoint ( fork_point) ) ;
201
201
break ;
202
202
}
203
203
@@ -206,16 +206,16 @@ async fn find_fork(current_header: BlockHeaderData, prev_header: &BlockHeaderDat
206
206
let current_height = current. height ;
207
207
let previous_height = previous. height ;
208
208
if current_height <= previous_height {
209
- steps_tx . push ( ForkStep :: DisconnectBlock ( previous) ) ;
209
+ steps . push ( ForkStep :: DisconnectBlock ( previous) ) ;
210
210
previous = look_up_prev_header ( block_source, & previous, cache, mainnet) . await ?;
211
211
}
212
212
if current_height >= previous_height {
213
- steps_tx . push ( ForkStep :: ConnectBlock ( current) ) ;
213
+ steps . push ( ForkStep :: ConnectBlock ( current) ) ;
214
214
current = look_up_prev_header ( block_source, & current, cache, mainnet) . await ?;
215
215
}
216
216
}
217
217
218
- Ok ( steps_tx )
218
+ Ok ( steps )
219
219
}
220
220
221
221
/// Adaptor used for notifying when blocks have been connected or disconnected from the chain.
0 commit comments