Skip to content

Commit

Permalink
Sign blocks with the worker key from the correct lookback epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Oct 22, 2020
1 parent e5fc307 commit d6f6d9c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion chain/gen/mining.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,17 @@ func MinerCreateBlock(ctx context.Context, sm *stmgr.StateManager, w api.WalletA
return nil, xerrors.Errorf("failed to load tipset state: %w", err)
}

worker, err := stmgr.GetMinerWorkerRaw(ctx, sm, st, bt.Miner)
lbts, err := stmgr.GetLookbackTipSetForRound(ctx, sm, pts, bt.Epoch)
if err != nil {
return nil, xerrors.Errorf("getting lookback miner actor state: %w", err)
}

lbst, _, err := sm.TipSetState(ctx, lbts)
if err != nil {
return nil, err
}

worker, err := stmgr.GetMinerWorkerRaw(ctx, sm, lbst, bt.Miner)
if err != nil {
return nil, xerrors.Errorf("failed to get miner worker: %w", err)
}
Expand Down

0 comments on commit d6f6d9c

Please sign in to comment.