mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: log failed tip fetch only after 20 tries (#7850)
This commit is contained in:
@ -425,6 +425,7 @@ impl NodeConfig {
|
||||
Client: HeadersClient,
|
||||
{
|
||||
info!(target: "reth::cli", ?tip, "Fetching tip block from the network.");
|
||||
let mut fetch_failures = 0;
|
||||
loop {
|
||||
match get_single_header(&client, tip).await {
|
||||
Ok(tip_header) => {
|
||||
@ -432,7 +433,10 @@ impl NodeConfig {
|
||||
return Ok(tip_header);
|
||||
}
|
||||
Err(error) => {
|
||||
error!(target: "reth::cli", %error, "Failed to fetch the tip. Retrying...");
|
||||
fetch_failures += 1;
|
||||
if fetch_failures % 20 == 0 {
|
||||
error!(target: "reth::cli", ?fetch_failures, %error, "Failed to fetch the tip. Retrying...");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user