message: Fixed error with early deleting
diff: @@ -215,8 +215,11 @@ impl CatchupHandler {
  while !process.pending_reps.is_empty() {
  let index = process.pending_reps.get_min_index()?;
  - let (mut first_resp, node_idx) = process.pending_reps.remove(index);
  + {
  + let &mut (ref mut first_resp, node_idx) = process.pending_reps.get_mut(index)
  + .ok_or(CommonError::InvalidStructure(format!("Element not Found")))?;
  if first_resp.min_tx()? - 1 != process.merkle_tree.count() { break; }
  +
  let mut temp_mt = process.merkle_tree.clone();
  while !first_resp.txns.is_empty() {
  let key = first_resp.min_tx()?.to_string();
  @@ -235,6 +238,8 @@ impl CatchupHandler {
  process.merkle_tree = temp_mt;
  }
  + process.pending_reps.remove(index);
  + }
  trace!("updated mt hash {}, tree {:?}", process.merkle_tree.root_hash().as_slice().to_base58(), process.merkle_tree);
  if &process.merkle_tree.count() == &self.target_mt_size {
  if process.merkle_tree.root_hash().ne(&self.target_mt_root) {
  