Merge pull request #747 from marco-storswift/master

bugfix haspower meaning
This commit is contained in:
Łukasz Magiera 2019-12-05 12:13:12 +01:00 committed by GitHub
commit 94c7b4bb33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -255,7 +255,7 @@ func (m *Miner) hasPower(ctx context.Context, addr address.Address, ts *types.Ti
return false, err
}
return power.MinerPower.Equals(types.NewInt(0)), nil
return !power.MinerPower.Equals(types.NewInt(0)), nil
}
func (m *Miner) mineOne(ctx context.Context, addr address.Address, base *MiningBase) (*types.BlockMsg, error) {
@ -266,7 +266,7 @@ func (m *Miner) mineOne(ctx context.Context, addr address.Address, base *MiningB
if err != nil {
return nil, xerrors.Errorf("checking if miner is slashed: %w", err)
}
if hasPower {
if !hasPower {
// slashed or just have no power yet
base.nullRounds++
return nil, nil