wallet: fix account loading

This commit is contained in:
ardocrat 2024-05-19 12:56:34 +03:00
parent 71fea20b90
commit f76e319d76

View file

@ -1184,6 +1184,15 @@ fn sync_wallet_data(wallet: &Wallet, from_node: bool) {
}
}
// Setup accounts data.
let last_height = info.1.last_confirmed_height;
let spendable = if wallet.get_data().is_none() {
None
} else {
Some(info.1.amount_currently_spendable)
};
update_accounts(wallet, last_height, spendable);
// Update wallet info.
{
let mut w_data = wallet.data.write();
@ -1195,15 +1204,6 @@ fn sync_wallet_data(wallet: &Wallet, from_node: bool) {
*w_data = Some(WalletData { info: info.1.clone(), txs });
}
// Setup accounts data.
let last_height = info.1.last_confirmed_height;
let spendable = if wallet.get_data().is_none() {
None
} else {
Some(info.1.amount_currently_spendable)
};
update_accounts(wallet, last_height, spendable);
// Update txs sync progress at separate thread.
let wallet_txs = wallet.clone();
let (txs_tx, txs_rx) = mpsc::channel::<StatusMessage>();