mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf: check block cache for requested header (#13890)
This commit is contained in:
6
crates/rpc/rpc-eth-types/src/cache/mod.rs
vendored
6
crates/rpc/rpc-eth-types/src/cache/mod.rs
vendored
@ -452,6 +452,12 @@ where
|
||||
continue
|
||||
}
|
||||
|
||||
// it's possible we have the entire block cached
|
||||
if let Some(block) = this.full_block_cache.get(&block_hash) {
|
||||
let _ = response_tx.send(Ok(block.clone_header()));
|
||||
continue
|
||||
}
|
||||
|
||||
// header is not in the cache, request it if this is the first
|
||||
// consumer
|
||||
if this.headers_cache.queue(block_hash, response_tx) {
|
||||
|
||||
Reference in New Issue
Block a user