Add peer to peer manager before fetching the tipset
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
3697a1af4d
commit
46d3769a44
@ -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