Skip to content

Commit 7c8edfa

Browse files
refactor: change try_get_balance_if_any to synchronous function
Updated the try_get_balance_if_any method to be synchronous instead of asynchronous. This change simplifies the balance retrieval process for wallets, improving performance and reducing complexity in the status display logic.
1 parent b732d2a commit 7c8edfa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

dash-spv/src/client/status_display.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl<'a, S: StorageManager + Send + Sync + 'static, W: WalletInterface + Send +
150150

151151
/// Helper to try to get wallet balance if W implements Any.
152152
/// This is a wrapper that handles the case where W might not implement Any.
153-
async fn try_get_balance_if_any(wallet: &W) -> Option<u64>
153+
fn try_get_balance_if_any(wallet: &W) -> Option<u64>
154154
where
155155
W: 'static,
156156
{
@@ -276,7 +276,6 @@ impl<'a, S: StorageManager + Send + Sync + 'static, W: WalletInterface + Send +
276276
// We use a helper that requires W: Any, so we need to handle this carefully
277277
// For now, we'll attempt to get balance only if possible
278278
Self::try_get_balance_if_any(&*wallet_guard)
279-
.await
280279
.map(|balance_sat| format!(" | Balance: {}", Self::format_balance(balance_sat)))
281280
.unwrap_or_default()
282281
} else {

0 commit comments

Comments
 (0)