Skip to content

Commit

Permalink
Ignore market balance after nv23
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenGround0 committed May 8, 2024
1 parent ebf1e00 commit 9d5a1e8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions chain/stmgr/supply.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,14 @@ func getFilPowerLocked(ctx context.Context, st *state.StateTree) (abi.TokenAmoun
return pst.TotalLocked()
}

func GetFilLocked(ctx context.Context, st *state.StateTree) (abi.TokenAmount, error) {

filMarketLocked, err := getFilMarketLocked(ctx, st)
if err != nil {
return big.Zero(), xerrors.Errorf("failed to get filMarketLocked: %w", err)
func GetFilLocked(ctx context.Context, st *state.StateTree, height abi.ChainEpoch) (abi.TokenAmount, error) {
filMarketLocked := big.Zero()
if height < build.UpgradeAussieHeight {
var err error
filMarketLocked, err = getFilMarketLocked(ctx, st)
if err != nil {
return big.Zero(), xerrors.Errorf("failed to get filMarketLocked: %w", err)
}
}

filPowerLocked, err := getFilPowerLocked(ctx, st)
Expand Down Expand Up @@ -360,7 +363,7 @@ func (sm *StateManager) GetVMCirculatingSupplyDetailed(ctx context.Context, heig
return api.CirculatingSupply{}, xerrors.Errorf("failed to calculate filBurnt: %w", err)
}

filLocked, err := GetFilLocked(ctx, st)
filLocked, err := GetFilLocked(ctx, st, height)
if err != nil {
return api.CirculatingSupply{}, xerrors.Errorf("failed to calculate filLocked: %w", err)
}
Expand Down

0 comments on commit 9d5a1e8

Please sign in to comment.