Skip to content

Commit

Permalink
Exit Early from Responding (#5637)
Browse files Browse the repository at this point in the history
* exit early
  • Loading branch information
nisdas committed Apr 27, 2020
1 parent 08a9fe9 commit 07e8609
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions beacon-chain/sync/rpc_beacon_blocks_by_range.go
Expand Up @@ -94,6 +94,11 @@ func (r *Service) beaconBlocksByRangeRPCHandler(ctx context.Context, msg interfa
endSlot = endReqSlot
}

// do not wait if all blocks have already been sent.
if startSlot > endReqSlot {
break
}

// wait for ticker before resuming streaming blocks to remote peer.
<-ticker.C
}
Expand Down

0 comments on commit 07e8609

Please sign in to comment.