Merge pull request #3667 from filecoin-project/fix/new-ts
Add peer to peer manager before fetching the tipset
This commit is contained in:
commit
b1d251e950
@ -104,6 +104,10 @@ func (hs *Service) HandleStream(s inet.Stream) {
|
|||||||
build.Clock.Sleep(time.Millisecond * 300)
|
build.Clock.Sleep(time.Millisecond * 300)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if hs.pmgr != nil {
|
||||||
|
hs.pmgr.AddFilecoinPeer(s.Conn().RemotePeer())
|
||||||
|
}
|
||||||
|
|
||||||
ts, err := hs.syncer.FetchTipSet(context.Background(), s.Conn().RemotePeer(), types.NewTipSetKey(hmsg.HeaviestTipSet...))
|
ts, err := hs.syncer.FetchTipSet(context.Background(), s.Conn().RemotePeer(), types.NewTipSetKey(hmsg.HeaviestTipSet...))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("failed to fetch tipset from peer during hello: %+v", err)
|
log.Errorf("failed to fetch tipset from peer during hello: %+v", err)
|
||||||
@ -117,9 +121,6 @@ func (hs *Service) HandleStream(s inet.Stream) {
|
|||||||
log.Infof("Got new tipset through Hello: %s from %s", ts.Cids(), s.Conn().RemotePeer())
|
log.Infof("Got new tipset through Hello: %s from %s", ts.Cids(), s.Conn().RemotePeer())
|
||||||
hs.syncer.InformNewHead(s.Conn().RemotePeer(), ts)
|
hs.syncer.InformNewHead(s.Conn().RemotePeer(), ts)
|
||||||
}
|
}
|
||||||
if hs.pmgr != nil {
|
|
||||||
hs.pmgr.AddFilecoinPeer(s.Conn().RemotePeer())
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user