several fixes and improvements while debugging interop
This commit is contained in:
+1
-1
@@ -59,7 +59,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/storage"
|
||||
"github.com/filecoin-project/lotus/storage/sealing"
|
||||
"github.com/filecoin-project/lotus/storage/sectorblocks"
|
||||
"github.com/filecoin-project/sector-storage"
|
||||
sectorstorage "github.com/filecoin-project/sector-storage"
|
||||
"github.com/filecoin-project/sector-storage/ffiwrapper"
|
||||
"github.com/filecoin-project/sector-storage/stores"
|
||||
)
|
||||
|
||||
@@ -92,6 +92,16 @@ func (hs *Service) HandleStream(s inet.Stream) {
|
||||
}
|
||||
}()
|
||||
|
||||
protos, err := hs.h.Peerstore().GetProtocols(s.Conn().RemotePeer())
|
||||
if err != nil {
|
||||
log.Warnf("got error from peerstore.GetProtocols: %s", err)
|
||||
}
|
||||
if len(protos) == 0 {
|
||||
log.Warn("other peer hasnt completed libp2p identify, waiting a bit")
|
||||
// TODO: this better
|
||||
time.Sleep(time.Millisecond * 300)
|
||||
}
|
||||
|
||||
ts, err := hs.syncer.FetchTipSet(context.Background(), s.Conn().RemotePeer(), types.NewTipSetKey(hmsg.HeaviestTipSet...))
|
||||
if err != nil {
|
||||
log.Errorf("failed to fetch tipset from peer during hello: %+v", err)
|
||||
|
||||
Reference in New Issue
Block a user