diff --git a/src/client/notes.rs b/src/client/notes.rs index 162cdb33c..3dc1c30e8 100644 --- a/src/client/notes.rs +++ b/src/client/notes.rs @@ -130,8 +130,13 @@ impl Client // Add the inclusion proof to the imported note info!("Requesting MMR data for past block num {}", inclusion_details.block_num); - let block_header = - self.get_and_store_authenticated_block(inclusion_details.block_num).await?; + let mut current_partial_mmr = self.build_current_partial_mmr(true)?; + let block_header = self + .get_and_store_authenticated_block( + inclusion_details.block_num, + &mut current_partial_mmr, + ) + .await?; let inclusion_proof = NoteInclusionProof::new( inclusion_details.block_num, block_header.sub_hash(), diff --git a/src/client/sync.rs b/src/client/sync.rs index 7b76e90a8..0ab849c9d 100644 --- a/src/client/sync.rs +++ b/src/client/sync.rs @@ -242,7 +242,7 @@ impl Client self.update_mmr_data().await?; let ignored_notes_sync = self.update_ignored_notes().await?; - total_sync_details.combine_with(&ignored_notes_sync); + total_sync_summary.combine_with(&ignored_notes_sync); return Ok(total_sync_summary); } @@ -258,7 +258,9 @@ impl Client .expect("Commited notes should have inclusion proofs") .origin() .block_num; - self.get_and_store_authenticated_block(block_num).await?; + let mut current_partial_mmr = self.build_current_partial_mmr(true)?; + self.get_and_store_authenticated_block(block_num, &mut current_partial_mmr) + .await?; } Ok(()) @@ -276,8 +278,12 @@ impl Client let updated_notes = note_details.len(); for details in note_details { + let mut current_partial_mmr = self.build_current_partial_mmr(true)?; let note_block = self - .get_and_store_authenticated_block(details.inclusion_details().block_num) + .get_and_store_authenticated_block( + details.inclusion_details().block_num, + &mut current_partial_mmr, + ) .await?; let note_inclusion_proof = NoteInclusionProof::new(