Skip to content

Commit

Permalink
fix sector list power after extension (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr authored Oct 13, 2024
1 parent 1b422b2 commit 548d941
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/sptool/sector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions web/api/sector/sector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 548d941

Please sign in to comment.