Skip to content

Commit d33c7c3

Browse files
committed
Rename steps_tx to steps
1 parent 6f382b4 commit d33c7c3

File tree

1 file changed

+8
-8
lines changed
  • lightning-block-sync/src

1 file changed

+8
-8
lines changed

lightning-block-sync/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ enum ForkStep {
176176
/// `prev_header` as its tip. There is no ordering guarantee between different ForkStep types, but
177177
/// `DisconnectBlock` and `ConnectBlock` are each returned in height-descending order.
178178
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();
180180
let mut current = current_header;
181181
let mut previous = *prev_header;
182182
loop {
@@ -188,16 +188,16 @@ async fn find_fork(current_header: BlockHeaderData, prev_header: &BlockHeaderDat
188188
// Found the parent block.
189189
if current.height - 1 == previous.height &&
190190
current.header.prev_blockhash == previous.header.block_hash() {
191-
steps_tx.push(ForkStep::ConnectBlock(current));
191+
steps.push(ForkStep::ConnectBlock(current));
192192
break;
193193
}
194194

195195
// Found a chain fork.
196196
if current.header.prev_blockhash == previous.header.prev_blockhash {
197197
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));
201201
break;
202202
}
203203

@@ -206,16 +206,16 @@ async fn find_fork(current_header: BlockHeaderData, prev_header: &BlockHeaderDat
206206
let current_height = current.height;
207207
let previous_height = previous.height;
208208
if current_height <= previous_height {
209-
steps_tx.push(ForkStep::DisconnectBlock(previous));
209+
steps.push(ForkStep::DisconnectBlock(previous));
210210
previous = look_up_prev_header(block_source, &previous, cache, mainnet).await?;
211211
}
212212
if current_height >= previous_height {
213-
steps_tx.push(ForkStep::ConnectBlock(current));
213+
steps.push(ForkStep::ConnectBlock(current));
214214
current = look_up_prev_header(block_source, &current, cache, mainnet).await?;
215215
}
216216
}
217217

218-
Ok(steps_tx)
218+
Ok(steps)
219219
}
220220

221221
/// Adaptor used for notifying when blocks have been connected or disconnected from the chain.

0 commit comments

Comments
 (0)