Skip to content

Commit

Permalink
replacing method of rpc to check if a endpoint is an archive node or …
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmenendez committed Jun 21, 2024
1 parent 10b2350 commit 237c90d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helpers/web3/web3_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ func isArchiveNode(ctx context.Context, client *ethclient.Client) (bool, error)
}
return false, fmt.Errorf("error getting block 1: %w", err)
}
if _, err := client.TransactionInBlock(ctx, block.Hash(), 0); err != nil {

if _, err := client.TransactionCount(ctx, block.Hash()); err != nil {
if notFoundTxRgx.MatchString(err.Error()) {
return false, nil
}
Expand Down

0 comments on commit 237c90d

Please sign in to comment.