From ed0cc0b56d85bbc2e584d3d00f2db6d03ae4aace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 8 Jul 2021 19:27:03 +0200 Subject: [PATCH] Handle bad peerIDs in MarketListRetrievalDeals --- cmd/lotus-storage-miner/info.go | 2 +- node/impl/storminer.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/lotus-storage-miner/info.go b/cmd/lotus-storage-miner/info.go index 12ccd549a..7a4e316ed 100644 --- a/cmd/lotus-storage-miner/info.go +++ b/cmd/lotus-storage-miner/info.go @@ -283,7 +283,7 @@ func infoCmdAct(cctx *cli.Context) error { return sorted[i].status > sorted[j].status }) - fmt.Printf("Deals: %d, %s\n", total.count, types.SizeStr(types.NewInt(uint64(total.bytes)))) + fmt.Printf("Storage Deals: %d, %s\n", total.count, types.SizeStr(types.NewInt(uint64(total.bytes)))) tw := tabwriter.NewWriter(os.Stdout, 1, 1, 1, ' ', 0) for _, e := range sorted { _, _ = tw.Write([]byte(e.str)) diff --git a/node/impl/storminer.go b/node/impl/storminer.go index 61c69b2ba..bbaf52bc6 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -454,6 +454,11 @@ func (sm *StorageMinerAPI) MarketListRetrievalDeals(ctx context.Context) ([]retr deals := sm.RetrievalProvider.ListDeals() for _, deal := range deals { + if deal.ChannelID != nil { + if deal.ChannelID.Initiator == "" || deal.ChannelID.Responder == "" { + deal.ChannelID = nil // don't try to push unparsable peer IDs over jsonrpc + } + } out = append(out, deal) }