From 5670cafda49f46eb9d42e966c760f6ab45020a67 Mon Sep 17 00:00:00 2001 From: Sagar Dhawan Date: Tue, 12 Nov 2019 10:29:58 -0800 Subject: [PATCH] Fix caching data shreds as coding shreds (#6877) --- ledger/src/blocktree.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ledger/src/blocktree.rs b/ledger/src/blocktree.rs index 76d407d6c..11fae6ce1 100644 --- a/ledger/src/blocktree.rs +++ b/ledger/src/blocktree.rs @@ -512,7 +512,7 @@ impl Blocktree { &mut index_working_set, &mut slot_meta_working_set, &mut write_batch, - &mut just_inserted_coding_shreds, + &mut just_inserted_data_shreds, &mut index_meta_time, ); } @@ -733,12 +733,7 @@ impl Blocktree { // Assert guaranteed by integrity checks on the shred that happen before // `insert_coding_shred` is called - if shred.is_data() || shred_index < u64::from(shred.coding_header.position) { - error!("Due to earlier validation, shred index must be >= pos"); - return Err(BlocktreeError::InvalidShredData(Box::new( - bincode::ErrorKind::Custom("shred index < pos".to_string()), - ))); - } + assert!(shred.is_code() && shred_index >= u64::from(shred.coding_header.position)); // Commit step: commit all changes to the mutable structures at once, or none at all. // We don't want only a subset of these changes going through.