several fixes and improvements while debugging interop

This commit is contained in:
Jeromy
2020-03-31 18:35:23 -07:00
parent ea135991e3
commit 417d434973
9 changed files with 57 additions and 24 deletions
+1 -1
View File
@@ -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"
)
+10
View File
@@ -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)