Tweak StateMinerPreCommitDepositForPower based on network version
This commit is contained in:
parent
c0bbaebaf4
commit
76090193ea
@ -1186,6 +1186,7 @@ func (a *StateAPI) StateMinerPreCommitDepositForPower(ctx context.Context, maddr
|
|||||||
store := a.Chain.ActorStore(ctx)
|
store := a.Chain.ActorStore(ctx)
|
||||||
|
|
||||||
var sectorWeight abi.StoragePower
|
var sectorWeight abi.StoragePower
|
||||||
|
if a.StateManager.GetNetworkVersion(ctx, ts.Height()) <= network.Version16 {
|
||||||
if act, err := state.GetActor(market.Address); err != nil {
|
if act, err := state.GetActor(market.Address); err != nil {
|
||||||
return types.EmptyInt, xerrors.Errorf("loading market actor %s: %w", maddr, err)
|
return types.EmptyInt, xerrors.Errorf("loading market actor %s: %w", maddr, err)
|
||||||
} else if s, err := market.Load(store, act); err != nil {
|
} else if s, err := market.Load(store, act); err != nil {
|
||||||
@ -1197,6 +1198,9 @@ func (a *StateAPI) StateMinerPreCommitDepositForPower(ctx context.Context, maddr
|
|||||||
duration := pci.Expiration - ts.Height()
|
duration := pci.Expiration - ts.Height()
|
||||||
sectorWeight = builtin.QAPowerForWeight(ssize, duration, w, vw)
|
sectorWeight = builtin.QAPowerForWeight(ssize, duration, w, vw)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
sectorWeight = minertypes.QAPowerMax(ssize)
|
||||||
|
}
|
||||||
|
|
||||||
var powerSmoothed builtin.FilterEstimate
|
var powerSmoothed builtin.FilterEstimate
|
||||||
if act, err := state.GetActor(power.Address); err != nil {
|
if act, err := state.GetActor(power.Address); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user