Skip to content

Commit

Permalink
remove redundant graph sync message loop
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricfung committed May 21, 2024
1 parent 99b6111 commit 4f5af0d
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions p2p/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,8 @@ func (me *Peer) loopSendingStream(p *Peer, consumer Client) (*ChanMsg, error) {
defer close(p.ops)
defer consumer.Close("loopSendingStream")

graphTicker := time.NewTicker(time.Duration(config.SnapshotRoundGap / 2))
defer graphTicker.Stop()

for !me.closing && !p.closing {
msgs := []*ChanMsg{}
select {
case <-graphTicker.C:
me.sentMetric.handle(PeerMessageTypeGraph)
msg := buildGraphMessage(me.handle)
msgs = append(msgs, &ChanMsg{nil, msg})
default:
}

for len(msgs) < 16 {
item, err := p.highRing.Poll(false)
if err != nil {
Expand Down

0 comments on commit 4f5af0d

Please sign in to comment.