Merge pull request #4049 from filecoin-project/fix/miner-power-cli
fix GetPower with no miner address
This commit is contained in:
commit
bc495a5c8c
@ -102,6 +102,7 @@ func GetPowerRaw(ctx context.Context, sm *StateManager, st cid.Cid, maddr addres
|
|||||||
}
|
}
|
||||||
|
|
||||||
var mpow power.Claim
|
var mpow power.Claim
|
||||||
|
var minpow bool
|
||||||
if maddr != address.Undef {
|
if maddr != address.Undef {
|
||||||
var found bool
|
var found bool
|
||||||
mpow, found, err = pas.MinerPower(maddr)
|
mpow, found, err = pas.MinerPower(maddr)
|
||||||
@ -109,12 +110,12 @@ func GetPowerRaw(ctx context.Context, sm *StateManager, st cid.Cid, maddr addres
|
|||||||
// TODO: return an error when not found?
|
// TODO: return an error when not found?
|
||||||
return power.Claim{}, power.Claim{}, false, err
|
return power.Claim{}, power.Claim{}, false, err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
minpow, err := pas.MinerNominalPowerMeetsConsensusMinimum(maddr)
|
minpow, err = pas.MinerNominalPowerMeetsConsensusMinimum(maddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return power.Claim{}, power.Claim{}, false, err
|
return power.Claim{}, power.Claim{}, false, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return mpow, tpow, minpow, nil
|
return mpow, tpow, minpow, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user