diff --git a/ledger/src/shred.rs b/ledger/src/shred.rs index c2ff25a266a20d..b3b0bd2db1e291 100644 --- a/ledger/src/shred.rs +++ b/ledger/src/shred.rs @@ -659,22 +659,14 @@ pub mod layout { match get_shred_variant(shred).ok()? { ShredVariant::LegacyCode | ShredVariant::LegacyData => { let offsets = self::legacy::SIGNED_MESSAGE_OFFSETS; - (offsets.end <= shred.len()).then_some(offsets) + (offsets.end <= shred.len()).then(|| offsets) } -<<<<<<< HEAD - ShredVariant::MerkleData(proof_size) => { - merkle::ShredData::get_signed_data_offsets(proof_size)? - } - }; - (offsets.end <= shred.len()).then(|| offsets) -======= // Merkle shreds sign merkle tree root which can be recovered from // the merkle proof embedded in the payload but itself is not // stored the payload. ShredVariant::MerkleCode(_) => None, ShredVariant::MerkleData(_) => None, } ->>>>>>> cf0a149ad (removes the merkle root from shreds binary (#29427)) } pub(crate) fn get_reference_tick(shred: &[u8]) -> Result { diff --git a/ledger/src/shred/merkle.rs b/ledger/src/shred/merkle.rs index baf48dc5446439..146b1f98d5b8f3 100644 --- a/ledger/src/shred/merkle.rs +++ b/ledger/src/shred/merkle.rs @@ -560,9 +560,7 @@ where }; (index >> 1, parent) }); - (index == 0) - .then_some(root) - .ok_or(Error::InvalidMerkleProof) + (index == 0).then(|| root).ok_or(Error::InvalidMerkleProof) } fn get_merkle_proof( @@ -619,7 +617,7 @@ fn make_merkle_proof( size = (size + 1) >> 1; index >>= 1; } - (offset + 1 == tree.len()).then_some(proof) + (offset + 1 == tree.len()).then(|| proof) } pub(super) fn recover(