Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
chmllr committed Feb 21, 2025
1 parent 24b6ad1 commit 5736b26
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions octane/evmengine/keeper/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/omni-network/omni/lib/cast"
"github.com/omni-network/omni/lib/errors"
"github.com/omni-network/omni/lib/umath"

"github.com/ethereum/go-ethereum/beacon/engine"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -132,12 +133,16 @@ func (k *Keeper) EligibleWithdrawals(ctx context.Context) ([]*Withdrawal, error)
return nil, errors.Wrap(err, "get withdrawal")
}

if val.GetCreatedHeight() < uint64(height) {
withdrawals = append(withdrawals, val)
if val.GetCreatedHeight() >= uint64(height) {
// Withdrawals created in this block are not eligible
break
}

withdrawals = append(withdrawals, val)

if uint64(len(withdrawals)) == k.maxWithdrawalsPerBlock {
break
}
if umath.Len(withdrawals) == k.maxWithdrawalsPerBlock {
// Reached the max number of withdrawals
break
}
}

Expand Down

0 comments on commit 5736b26

Please sign in to comment.