fix null incrementing

This commit is contained in:
Jeromy 2020-06-11 17:11:38 -07:00 committed by Łukasz Magiera
parent 5469df7dd1
commit c7e3a5cff4

View File

@ -188,6 +188,8 @@ func (m *Miner) mine(ctx context.Context) {
log.Errorf("failed to submit newly mined block: %s", err) log.Errorf("failed to submit newly mined block: %s", err)
} }
} else { } else {
base.NullRounds++
// Wait until the next epoch, plus the propagation delay, so a new tipset // Wait until the next epoch, plus the propagation delay, so a new tipset
// has enough time to form. // has enough time to form.
// //
@ -261,7 +263,6 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (*types.BlockMsg,
return nil, xerrors.Errorf("failed to get mining base info: %w", err) return nil, xerrors.Errorf("failed to get mining base info: %w", err)
} }
if mbi == nil { if mbi == nil {
base.NullRounds++
return nil, nil return nil, nil
} }
@ -278,7 +279,6 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (*types.BlockMsg,
} }
if !hasPower { if !hasPower {
// slashed or just have no power yet // slashed or just have no power yet
base.NullRounds++
return nil, nil return nil, nil
} }
@ -302,7 +302,6 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (*types.BlockMsg,
} }
if winner == nil { if winner == nil {
base.NullRounds++
return nil, nil return nil, nil
} }