Skip to content

Commit

Permalink
Update state_transition.go
Browse files Browse the repository at this point in the history
Add discount rate is bigger than zero
  • Loading branch information
ggcore0 committed Feb 14, 2025
1 parent 4f7d5b9 commit a0a7797
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
"rewardsCount", len(discountConfig.Rewards))

// Check if the discount config is active and has a timestamp
if discountConfig.IsActive {
if discountConfig.IsActive && discountConfig.DiscountRate != nil && discountConfig.DiscountRate.Sign() > 0 {
if discountConfig.UserDiscountRate != nil {
userDiscountAmount := new(big.Int).Mul(totalSystemReward, discountConfig.UserDiscountRate)
userDiscountAmount = userDiscountAmount.Div(userDiscountAmount, LFM_DISCOUNT_PERCENTAGE_DENOMINATOR)
Expand Down

0 comments on commit a0a7797

Please sign in to comment.