Skip to content

Commit

Permalink
use const for ticker period
Browse files Browse the repository at this point in the history
  • Loading branch information
jimjbrettj committed Oct 15, 2024
1 parent 3c17fcc commit 38ae1e9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/grandpa/neighbor_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ func (nt *NeighborTracker) Stop() {

func (nt *NeighborTracker) run() {
logger.Info("starting neighbor tracker")
const duration = NeighborBroadcastPeriod
ticker := time.NewTicker(duration)
ticker := time.NewTicker(NeighborBroadcastPeriod)
defer ticker.Stop()

for {
Expand All @@ -78,7 +77,7 @@ func (nt *NeighborTracker) run() {
if err != nil {
logger.Errorf("broadcasting neighbor message: %v", err)
}
ticker.Reset(duration)
ticker.Reset(NeighborBroadcastPeriod)
}
case neighborData := <-nt.neighborMsgChan:
if neighborData.neighborMsg.Number > nt.peerview[neighborData.peer].highestFinalized {
Expand Down

0 comments on commit 38ae1e9

Please sign in to comment.