Skip utxo retrieval when there are no transparent addresses in the wallet.

This commit is contained in:
Kris Nuttycombe 2024-08-30 17:57:40 -06:00
parent 0baa279695
commit 5c03537777
1 changed files with 11 additions and 5 deletions

View File

@ -638,12 +638,18 @@ async fn refresh_utxos<P: Parameters>(
account_id: AccountId,
start_height: BlockHeight,
) -> Result<(), anyhow::Error> {
let addresses = db_data
.get_transparent_receivers(account_id)?
.into_keys()
.map(|addr| addr.encode(params))
.collect::<Vec<_>>();
if addresses.is_empty() {
return Ok(());
}
let request = service::GetAddressUtxosArg {
addresses: db_data
.get_transparent_receivers(account_id)?
.into_keys()
.map(|addr| addr.encode(params))
.collect(),
addresses,
start_height: start_height.into(),
max_entries: 0,
};