Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Await on entire fetch to finish
  • Loading branch information
sug0 committed Nov 12, 2024
commit 18848f86914bd588e0901515d53030a42c0c17d5
6 changes: 2 additions & 4 deletions crates/sdk/src/masp/utilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ impl<C: Client + Send + Sync> MaspClient for LedgerMaspClient<C> {
from: BlockHeight,
to: BlockHeight,
) -> Result<Vec<IndexedNoteEntry>, Error> {
let _permit = self.inner.semaphore.acquire().await.unwrap();

// Fetch all the transactions we do not have yet
let mut txs = vec![];

for height in from.0..=to.0 {
let maybe_txs_results = async {
let _permit = self.inner.semaphore.acquire().await.unwrap();

get_indexed_masp_events_at_height(
&self.inner.client,
height.into(),
Expand All @@ -86,8 +86,6 @@ impl<C: Client + Send + Sync> MaspClient for LedgerMaspClient<C> {
};

let block = {
let _permit = self.inner.semaphore.acquire().await.unwrap();

// Query the actual block to get the txs bytes. If we only need
// one tx it might be slightly better to query
// the /tx endpoint to reduce the amount of data
Expand Down