fix(storageminer): add missing err check

Missing an err check in storage miner initialization in the stored ask
This commit is contained in:
hannahhoward 2020-05-28 17:05:17 -07:00
parent 2632621f7e
commit 0c4db8cf6b

View File

@ -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)) 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 // Hacky way to set max piece size to the sector size
a := storedAsk.GetAsk(address.Address(minerAddress)).Ask a := storedAsk.GetAsk(address.Address(minerAddress)).Ask
err = storedAsk.AddAsk(a.Price, a.Expiry-a.Timestamp, storagemarket.MaxPieceSize(abi.PaddedPieceSize(mi.SectorSize))) err = storedAsk.AddAsk(a.Price, a.Expiry-a.Timestamp, storagemarket.MaxPieceSize(abi.PaddedPieceSize(mi.SectorSize)))