From c337a5b7289184969affe6851dc012177fb75051 Mon Sep 17 00:00:00 2001 From: marco-storswift Date: Thu, 5 Dec 2019 13:49:11 +0800 Subject: [PATCH] bugfix haspower meaning --- miner/miner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miner/miner.go b/miner/miner.go index df2b3cdaa..96e10266b 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -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