plumb contexts in lotus-miner

This commit is contained in:
vyzo 2021-12-13 14:28:29 +02:00
parent 84710cf27e
commit 2e057b8f52
2 changed files with 5 additions and 5 deletions

View File

@ -347,7 +347,7 @@ func migratePreSealMeta(ctx context.Context, api v1api.FullNode, metadata string
return err
}
if err := mds.Put(sectorKey, b); err != nil {
if err := mds.Put(context.Background(), sectorKey, b); err != nil {
return err
}
@ -387,7 +387,7 @@ func migratePreSealMeta(ctx context.Context, api v1api.FullNode, metadata string
buf := make([]byte, binary.MaxVarintLen64)
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) {
@ -441,7 +441,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api v1api.FullNode
}
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
}
@ -548,7 +548,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api v1api.FullNode
}
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
}

View File

@ -255,7 +255,7 @@ func restore(ctx context.Context, cctx *cli.Context, targetPath string, strConfi
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 {
return xerrors.Errorf("getting actor address from metadata datastore: %w", err)
}