From f8c886a611b83091f6d4b699493fb351ff27b6c3 Mon Sep 17 00:00:00 2001 From: Aayush Rajasekaran Date: Tue, 6 Oct 2020 03:49:11 -0400 Subject: [PATCH] Rename MiningBaseInfo.HasMinPower to EligibleForMining --- api/api_full.go | 16 ++++++++-------- chain/stmgr/utils.go | 16 ++++++++-------- miner/miner.go | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/api/api_full.go b/api/api_full.go index 5cbdde8e3..07b48a7eb 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -806,14 +806,14 @@ type CirculatingSupply struct { } type MiningBaseInfo struct { - MinerPower types.BigInt - NetworkPower types.BigInt - Sectors []builtin.SectorInfo - WorkerKey address.Address - SectorSize abi.SectorSize - PrevBeaconEntry types.BeaconEntry - BeaconEntries []types.BeaconEntry - HasMinPower bool + MinerPower types.BigInt + NetworkPower types.BigInt + Sectors []builtin.SectorInfo + WorkerKey address.Address + SectorSize abi.SectorSize + PrevBeaconEntry types.BeaconEntry + BeaconEntries []types.BeaconEntry + EligibleForMining bool } type BlockTemplate struct { diff --git a/chain/stmgr/utils.go b/chain/stmgr/utils.go index 98f6bc5ac..6b43303f0 100644 --- a/chain/stmgr/utils.go +++ b/chain/stmgr/utils.go @@ -506,14 +506,14 @@ func MinerGetBaseInfo(ctx context.Context, sm *StateManager, bcs beacon.Schedule } return &api.MiningBaseInfo{ - MinerPower: mpow.QualityAdjPower, - NetworkPower: tpow.QualityAdjPower, - Sectors: sectors, - WorkerKey: worker, - SectorSize: info.SectorSize, - PrevBeaconEntry: *prev, - BeaconEntries: entries, - HasMinPower: hmp, + MinerPower: mpow.QualityAdjPower, + NetworkPower: tpow.QualityAdjPower, + Sectors: sectors, + WorkerKey: worker, + SectorSize: info.SectorSize, + PrevBeaconEntry: *prev, + BeaconEntries: entries, + EligibleForMining: hmp, }, nil } diff --git a/miner/miner.go b/miner/miner.go index d4e7b2317..a256e8b3a 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -362,7 +362,7 @@ func (m *Miner) mineOne(ctx context.Context, base *MiningBase) (*types.BlockMsg, if mbi == nil { return nil, nil } - if !mbi.HasMinPower { + if !mbi.EligibleForMining { // slashed or just have no power yet return nil, nil }