plumb contexts in lotus-miner
This commit is contained in:
parent
35b8516288
commit
074f3850d8
@ -347,7 +347,7 @@ func migratePreSealMeta(ctx context.Context, api v1api.FullNode, metadata string
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := mds.Put(sectorKey, b); err != nil {
|
if err := mds.Put(context.Background(), sectorKey, b); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -387,7 +387,7 @@ func migratePreSealMeta(ctx context.Context, api v1api.FullNode, metadata string
|
|||||||
|
|
||||||
buf := make([]byte, binary.MaxVarintLen64)
|
buf := make([]byte, binary.MaxVarintLen64)
|
||||||
size := binary.PutUvarint(buf, uint64(maxSectorID))
|
size := binary.PutUvarint(buf, uint64(maxSectorID))
|
||||||
return mds.Put(datastore.NewKey(modules.StorageCounterDSPrefix), buf[:size])
|
return mds.Put(context.Background(), datastore.NewKey(modules.StorageCounterDSPrefix), buf[:size])
|
||||||
}
|
}
|
||||||
|
|
||||||
func findMarketDealID(ctx context.Context, api v1api.FullNode, deal market2.DealProposal) (abi.DealID, error) {
|
func findMarketDealID(ctx context.Context, api v1api.FullNode, deal market2.DealProposal) (abi.DealID, error) {
|
||||||
@ -441,7 +441,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api v1api.FullNode
|
|||||||
}
|
}
|
||||||
|
|
||||||
if cctx.Bool("genesis-miner") {
|
if cctx.Bool("genesis-miner") {
|
||||||
if err := mds.Put(datastore.NewKey("miner-address"), a.Bytes()); err != nil {
|
if err := mds.Put(context.Background(), datastore.NewKey("miner-address"), a.Bytes()); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -548,7 +548,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api v1api.FullNode
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.Infof("Created new miner: %s", addr)
|
log.Infof("Created new miner: %s", addr)
|
||||||
if err := mds.Put(datastore.NewKey("miner-address"), addr.Bytes()); err != nil {
|
if err := mds.Put(context.Background(), datastore.NewKey("miner-address"), addr.Bytes()); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ func restore(ctx context.Context, cctx *cli.Context, targetPath string, strConfi
|
|||||||
|
|
||||||
log.Info("Checking actor metadata")
|
log.Info("Checking actor metadata")
|
||||||
|
|
||||||
abytes, err := mds.Get(datastore.NewKey("miner-address"))
|
abytes, err := mds.Get(context.Background(), datastore.NewKey("miner-address"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("getting actor address from metadata datastore: %w", err)
|
return xerrors.Errorf("getting actor address from metadata datastore: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user