mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 12:11:59 +00:00
chore: reduce scope of commitment (#5426)
* reduce scope of commitment * avoid clone for last reference * Merge branch 'unstable' of https://github.com/sigp/lighthouse into mod_merge_single_blob
This commit is contained in:
@@ -108,11 +108,10 @@ pub trait AvailabilityView<E: EthSpec> {
|
||||
/// 1. The blob entry at the index is empty and no block exists, or
|
||||
/// 2. The block exists and its commitment matches the blob's commitment.
|
||||
fn merge_single_blob(&mut self, index: usize, blob: Self::BlobType) {
|
||||
let commitment = *blob.get_commitment();
|
||||
if let Some(cached_block) = self.get_cached_block() {
|
||||
let block_commitment_opt = cached_block.get_commitments().get(index).copied();
|
||||
if let Some(block_commitment) = block_commitment_opt {
|
||||
if block_commitment == commitment {
|
||||
if block_commitment == *blob.get_commitment() {
|
||||
self.insert_blob_at_index(index, blob)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user