aboutsummaryrefslogtreecommitdiffstats
path: root/dex/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'dex/app.go')
-rw-r--r--dex/app.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/dex/app.go b/dex/app.go
index df76b2b7d..623bb8dff 100644
--- a/dex/app.go
+++ b/dex/app.go
@@ -200,16 +200,15 @@ addressMap:
expectNonce = lastConfirmedNonce + 1
}
- for _, tx := range txs {
- if expectNonce == tx.Nonce() {
- expectNonce++
- } else if expectNonce < tx.Nonce() {
- break
- } else if expectNonce > tx.Nonce() {
- log.Debug("Skipping tx with smaller nonce then expected", "expected", expectNonce, "nonce", tx.Nonce())
- continue
- }
+ if len(txs) == 0 {
+ continue
+ }
+
+ firstNonce := txs[0].Nonce()
+ startIndex := int(expectNonce - firstNonce)
+ for i := startIndex; i < len(txs); i++ {
+ tx := txs[i]
intrGas, err := core.IntrinsicGas(tx.Data(), tx.To() == nil, true)
if err != nil {
log.Error("Failed to calculate intrinsic gas", "error", err)