[reward] log whatPercentStakedNow

pull/1942/head
Edgar Aroutiounian 5 years ago
parent 89ec5ac541
commit c2d0315823
  1. 11
      internal/chain/reward.go

@ -148,6 +148,8 @@ func whatPercentStakedNow(
return nil, err return nil, err
} }
dole := numeric.NewDecFromBigInt(soFarDoledOut)
for i := range active { for i := range active {
wrapper, err := beaconchain.ReadValidatorInformation(active[i]) wrapper, err := beaconchain.ReadValidatorInformation(active[i])
if err != nil { if err != nil {
@ -159,9 +161,12 @@ func whatPercentStakedNow(
} }
percentage := stakedNow.Quo(totalTokens.Mul( percentage := stakedNow.Quo(totalTokens.Mul(
reward.PercentageForTimeStamp(timestamp), reward.PercentageForTimeStamp(timestamp),
).Add( ).Add(dole))
numeric.NewDecFromBigInt(soFarDoledOut)), utils.Logger().Info().
) Str("so-far-doled-out", dole.String()).
Str("staked-percentage", percentage.String()).
Str("currently-staked", stakedNow.String()).
Msg("Computed how much staked right now")
return &percentage, nil return &percentage, nil
} }

Loading…
Cancel
Save