Skip to content

Commit

Permalink
Cherry pick gouging fix (#1589)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl authored Oct 2, 2024
2 parents 6ec5143 + 14762ab commit 4292d08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/gouging/gouging.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ func checkPriceGougingPT(gs api.GougingSettings, cs api.ConsensusState, txnFee t
}
}

// check TxnFeeMaxRecommended - expect at most a multiple of our fee
if !txnFee.IsZero() && pt.TxnFeeMaxRecommended.Cmp(txnFee.Mul64(5)) > 0 {
return fmt.Errorf("TxnFeeMaxRecommended %v exceeds %v", pt.TxnFeeMaxRecommended, txnFee.Mul64(5))
// check TxnFeeMaxRecommended - expect it to be lower or equal than the max contract price
if !gs.MaxContractPrice.IsZero() && pt.TxnFeeMaxRecommended.Mul64(4096).Cmp(gs.MaxContractPrice) > 0 {
return fmt.Errorf("TxnFeeMaxRecommended %v exceeds %v", pt.TxnFeeMaxRecommended, gs.MaxContractPrice.Div64(4096))
}

// check TxnFeeMinRecommended - expect it to be lower or equal than the max
Expand Down

0 comments on commit 4292d08

Please sign in to comment.