Skip to content

Commit 58ef2a3

Browse files
committed
update range
1 parent 0a9d525 commit 58ef2a3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/block_range_scanner.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,8 @@ impl<N: Network> Service<N> {
555555

556556
info!(batch_count = batch_count, "Historical sync completed");
557557

558-
if let Some(sender) = &self.subscriber &&
559-
sender.send(Err(Error::Eof)).await.is_err()
558+
if let Some(sender) = &self.subscriber
559+
&& sender.send(Err(Error::Eof)).await.is_err()
560560
{
561561
warn!("Subscriber channel closed, cleaning up");
562562
}
@@ -580,7 +580,7 @@ impl<N: Network> Service<N> {
580580
let incoming_block_num = incoming_block.number();
581581
info!(block_number = incoming_block_num, "Received block header");
582582

583-
if incoming_block_num < current {
583+
if incoming_block_num <= current {
584584
// TODO: send reorg err - issue is this causes event scanner to stop
585585
// if sender.send(Err(Error::ReorgDetected)).await.is_err() {
586586
// warn!("Downstream channel closed, stopping live blocks task");
@@ -591,11 +591,7 @@ impl<N: Network> Service<N> {
591591
// reorg depth? The incoming block should be the
592592
// latest block from the reorg point so no real need
593593
// tbd
594-
if sender
595-
.send(Ok(incoming_block_num..=incoming_block_num + 1))
596-
.await
597-
.is_err()
598-
{
594+
if sender.send(Ok(incoming_block_num..=current)).await.is_err() {
599595
warn!("Downstream channel closed, stopping live blocks task (reorg)");
600596
return;
601597
}

0 commit comments

Comments
 (0)