Skip to content

Commit 76e1aa7

Browse files
author
Christopher Campbell
committed
use header rather than block to get latest number during init
1 parent 2002ac3 commit 76e1aa7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

synchronizer/init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ func InitStartBlock(db db.DB, em etherman.Etherman, genesisBlock uint64, validiu
4545
}
4646

4747
func findContractDeploymentBlock(ctx context.Context, em etherman.Etherman, contract common.Address) (*big.Int, error) {
48-
latestBlock, err := em.BlockByNumber(ctx, nil)
48+
latestHeader, err := em.HeaderByNumber(ctx, nil)
4949
if err != nil {
5050
return nil, err
5151
}
52-
firstBlock := findCode(ctx, em, contract, 0, latestBlock.Number().Int64())
52+
firstBlock := findCode(ctx, em, contract, 0, latestHeader.Number.Int64())
5353
return big.NewInt(firstBlock), nil
5454
}
5555

0 commit comments

Comments
 (0)