From 548d941327a1b558670dd7232c1888e89738ef65 Mon Sep 17 00:00:00 2001 From: LexLuthr <88259624+LexLuthr@users.noreply.github.com> Date: Sun, 13 Oct 2024 10:39:57 +0400 Subject: [PATCH] fix sector list power after extension (#273) --- cmd/sptool/sector.go | 4 ++-- web/api/sector/sector.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/sptool/sector.go b/cmd/sptool/sector.go index 11ddecf0f..21925596d 100644 --- a/cmd/sptool/sector.go +++ b/cmd/sptool/sector.go @@ -297,8 +297,8 @@ var sectorsListCmd = &cli.Command{ dw, vp := .0, .0 { rdw := big.Add(st.DealWeight, st.VerifiedDealWeight) - dw = float64(big.Div(rdw, big.NewInt(int64(st.Expiration-st.Activation))).Uint64()) - vp = float64(big.Div(big.Mul(st.VerifiedDealWeight, big.NewInt(verifiedPowerGainMul)), big.NewInt(int64(st.Expiration-st.Activation))).Uint64()) + dw = float64(big.Div(rdw, big.NewInt(int64(st.Expiration-st.PowerBaseEpoch))).Uint64()) + vp = float64(big.Div(big.Mul(st.VerifiedDealWeight, big.NewInt(verifiedPowerGainMul)), big.NewInt(int64(st.Expiration-st.PowerBaseEpoch))).Uint64()) } var deals int diff --git a/web/api/sector/sector.go b/web/api/sector/sector.go index bac4bc82e..c6b9aea7f 100644 --- a/web/api/sector/sector.go +++ b/web/api/sector/sector.go @@ -234,8 +234,8 @@ func (c *cfg) getSectors(w http.ResponseWriter, r *http.Request) { } } else { rdw := big.Add(st.DealWeight, st.VerifiedDealWeight) - dw = float64(big.Div(rdw, big.NewInt(int64(st.Expiration-st.Activation))).Uint64()) - vp = float64(big.Div(big.Mul(st.VerifiedDealWeight, big.NewInt(verifiedPowerGainMul)), big.NewInt(int64(st.Expiration-st.Activation))).Uint64()) + dw = float64(big.Div(rdw, big.NewInt(int64(st.Expiration-st.PowerBaseEpoch))).Uint64()) + vp = float64(big.Div(big.Mul(st.VerifiedDealWeight, big.NewInt(verifiedPowerGainMul)), big.NewInt(int64(st.Expiration-st.PowerBaseEpoch))).Uint64()) // DDO sectors don't have deal info on chain for _, p := range pi { if p.Manifest != nil {