Skip to content

Commit

Permalink
Fix indentation in track_new_blocks (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
ok300 authored Apr 18, 2024
1 parent 65a87eb commit 10eb7aa
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions libs/sdk-core/src/breez_services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1586,27 +1586,27 @@ impl BreezServices {
interval.set_missed_tick_behavior(MissedTickBehavior::Skip);
loop {
tokio::select! {
_ = interval.tick() => {
let tip_res = cloned.chain_service.current_tip().await;
match tip_res {
Ok(next_block) => {
debug!("got tip {:?}", next_block);
if next_block > current_block {
_ = cloned.sync().await;
_ = cloned.on_event(BreezEvent::NewBlock{block: next_block}).await;
_ = interval.tick() => {
let tip_res = cloned.chain_service.current_tip().await;
match tip_res {
Ok(next_block) => {
debug!("got tip {:?}", next_block);
if next_block > current_block {
_ = cloned.sync().await;
_ = cloned.on_event(BreezEvent::NewBlock{block: next_block}).await;
}
current_block = next_block
},
Err(e) => {
error!("failed to fetch next block {}", e)
}
};
}
current_block = next_block
},
Err(e) => {
error!("failed to fetch next block {}", e)
}
};
}

_ = shutdown_receiver.changed() => {
debug!("New blocks task has completed");
return;
}
_ = shutdown_receiver.changed() => {
debug!("New blocks task has completed");
return;
}
}
}
});
Expand Down

0 comments on commit 10eb7aa

Please sign in to comment.