better lag error

This commit is contained in:
Bryan Stitt 2022-12-05 14:45:12 -08:00
parent f5c0ce9a36
commit f010166ee0

View File

@ -617,7 +617,8 @@ impl Web3Connection {
if let Some(x) = &*conn.head_block.read() {
// if this block is too old, return an error so we reconnect
if x.lag() > 0 {
return Err(anyhow::anyhow!("provider is lagged"));
// TODO: instead of a full reconnect, we should maybe just set it to None
return Err(anyhow::anyhow!("{} is lagged: {:?}", conn, x));
}
}