Skip to content

Commit f636523

Browse files
committed
Check if empty block
1 parent 1ee6acb commit f636523

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Goerli deposit contract is `0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b` but some
6666
Store in `.env` so that it's picked up by `docker-compose`
6767

6868
```
69+
export NETWORK=goerli
6970
export POOL_ADDRESS=0x8eba4A4A8d4DFa78BCB734efD1eA9f33b61e3243
7071
export UPDATER_KEYSTORE_PASS=xxx
7172
```

oracle/block.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ func NewFullBlock(
5858
func (b *FullBlock) MevRewardInWei() (*big.Int, bool, string) {
5959

6060
txs := b.GetBlockTransactions()
61+
62+
// Check if block is empty (no txs)
63+
if len(txs) == 0 {
64+
return big.NewInt(0), false, ""
65+
}
66+
6167
lastTx := txs[len(txs)-1]
6268

6369
tx, msg, err := DecodeTx(lastTx)

0 commit comments

Comments
 (0)