Skip to content

Commit 19380d9

Browse files
committed
move logic
1 parent ea56196 commit 19380d9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

x/evm/types/tx_args.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ func (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int) (*
150150
if globalGasCap != 0 && globalGasCap < gas {
151151
gas = globalGasCap
152152
}
153+
// Limit gas cap to avoid DOS during simulation
154+
if gas > MaxGasCap {
155+
gas = MaxGasCap
156+
}
153157

154158
var (
155159
gasPrice *big.Int
@@ -201,11 +205,6 @@ func (args *TransactionArgs) ToMessage(globalGasCap uint64, baseFee *big.Int) (*
201205
nonce = uint64(*args.Nonce)
202206
}
203207

204-
// Limit gas cap to avoid DOS during simulation
205-
if gas > MaxGasCap {
206-
gas = MaxGasCap
207-
}
208-
209208
msg := &core.Message{
210209
From: addr,
211210
To: args.To,

0 commit comments

Comments
 (0)