From 0c4db8cf6b6435d81b9bd15f58afef53f8d5e3c7 Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Thu, 28 May 2020 17:05:17 -0700 Subject: [PATCH] fix(storageminer): add missing err check Missing an err check in storage miner initialization in the stored ask --- node/modules/storageminer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index f54a2672e..47a00eb38 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -298,6 +298,9 @@ func NewStorageAsk(ctx helpers.MetricsCtx, fapi lapi.FullNode, ds dtypes.Metadat } storedAsk, err := storedask.NewStoredAsk(namespace.Wrap(ds, datastore.NewKey("/deals/provider")), datastore.NewKey("latest-ask"), spn, address.Address(minerAddress)) + if err != nil { + return nil, err + } // Hacky way to set max piece size to the sector size a := storedAsk.GetAsk(address.Address(minerAddress)).Ask err = storedAsk.AddAsk(a.Price, a.Expiry-a.Timestamp, storagemarket.MaxPieceSize(abi.PaddedPieceSize(mi.SectorSize)))