Commit 1c34e9c9 authored by Ralph Pichler's avatar Ralph Pichler Committed by GitHub

fix: query header instead of block (#2372)

parent 16f1b391
......@@ -76,15 +76,15 @@ func WaitSynced(ctx context.Context, logger logging.Logger, backend Backend, max
}
}
func WaitBlock(ctx context.Context, backend Backend, pollingInterval time.Duration, block *big.Int) (*types.Block, error) {
func WaitBlock(ctx context.Context, backend Backend, pollingInterval time.Duration, block *big.Int) (*types.Header, error) {
for {
block, err := backend.BlockByNumber(ctx, block)
header, err := backend.HeaderByNumber(ctx, block)
if err != nil {
if !errors.Is(err, ethereum.NotFound) {
return nil, err
}
} else {
return block, nil
return header, nil
}
select {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment