fix continue
This commit is contained in:
parent
79f033e829
commit
85b8a3a4e8
@ -448,19 +448,20 @@ impl Web3Connection {
|
|||||||
.request("eth_getBlockByNumber", ("latest", false))
|
.request("eth_getBlockByNumber", ("latest", false))
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
if let Ok(block) = block {
|
||||||
// don't send repeat blocks
|
// don't send repeat blocks
|
||||||
if let Ok(block) = &block {
|
|
||||||
let new_hash = block.hash.unwrap();
|
let new_hash = block.hash.unwrap();
|
||||||
|
|
||||||
if new_hash == last_hash {
|
if new_hash != last_hash {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
last_hash = new_hash;
|
last_hash = new_hash;
|
||||||
}
|
|
||||||
|
|
||||||
|
self.send_block_result(Ok(block), &block_sender).await?;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// we got an empty block back. thats not good
|
||||||
self.send_block_result(block, &block_sender).await?;
|
self.send_block_result(block, &block_sender).await?;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
warn!(?err, "Rate limited on latest block from {}", self);
|
warn!(?err, "Rate limited on latest block from {}", self);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user