mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 20:57:10 +00:00
use slot so we dont hit the cache twice
This commit is contained in:
@@ -1085,15 +1085,17 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
|
||||
block_root: Hash256,
|
||||
lookup_peers: Arc<RwLock<HashSet<PeerId>>>,
|
||||
) -> Result<LookupRequestResult, RpcRequestSendError> {
|
||||
let slot = self
|
||||
.chain
|
||||
.canonical_head
|
||||
.fork_choice_read_lock()
|
||||
.get_block(&block_root)
|
||||
.map(|block| block.slot)
|
||||
.unwrap_or_else(|| self.chain.slot().unwrap_or_default());
|
||||
|
||||
let custody_indexes_imported = self
|
||||
.chain
|
||||
.data_availability_checker
|
||||
.cached_data_column_indexes(&block_root)
|
||||
.or_else(|| {
|
||||
self.chain
|
||||
.pending_payload_cache
|
||||
.cached_data_column_indexes(&block_root)
|
||||
})
|
||||
.cached_data_column_indexes(&block_root, slot)
|
||||
.unwrap_or_default();
|
||||
|
||||
let current_epoch = self.chain.epoch().map_err(|e| {
|
||||
|
||||
Reference in New Issue
Block a user