diff --git a/chain/blocksync/peer_tracker.go b/chain/blocksync/peer_tracker.go index 3a9d9089b..7c30b92a2 100644 --- a/chain/blocksync/peer_tracker.go +++ b/chain/blocksync/peer_tracker.go @@ -42,12 +42,9 @@ func newPeerTracker(lc fx.Lifecycle, h host.Host, pmgr *peermgr.PeerMgr) *bsPeer if err != nil { panic(err) } + go func() { - var newPeer interface{} - ok := true - for ok { - newPeer, ok = <-sub.Out() - log.Warnf("new peer from hello in tracker: %s", newPeer.(peermgr.NewFilPeer).Id) + for newPeer := range sub.Out() { bsPt.addPeer(newPeer.(peermgr.NewFilPeer).Id) } }()