Skip to content

Commit

Permalink
Wallet interface: do not load not used cold staking balances.
Browse files Browse the repository at this point in the history
 None of the cold staking balances are being used from this helper class at the moment, the CS screen has its own model and is calculating the values on-demand. Guarding them behind a flag to be activated in the future if they are needed.
  • Loading branch information
furszy committed Mar 11, 2021
1 parent dee4224 commit 0f197ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/interfaces/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ namespace interfaces {
result.unconfirmed_watch_only_balance = m_wallet.GetUnconfirmedWatchOnlyBalance();
result.immature_watch_only_balance = m_wallet.GetImmatureWatchOnlyBalance();
}
result.delegate_balance = m_wallet.GetDelegatedBalance();
result.coldstaked_balance = m_wallet.GetColdStakingBalance();
if (result.have_coldstaking) { // At the moment, the GUI is not using these two balances.
result.delegate_balance = m_wallet.GetDelegatedBalance();
result.coldstaked_balance = m_wallet.GetColdStakingBalance();
}
result.shielded_balance = m_wallet.GetAvailableShieldedBalance();
result.unconfirmed_shielded_balance = m_wallet.GetUnconfirmedShieldedBalance();
return result;
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ struct WalletBalances
CAmount watch_only_balance{0};
CAmount unconfirmed_watch_only_balance{0};
CAmount immature_watch_only_balance{0};
bool have_coldstaking{false};
CAmount delegate_balance{0};
CAmount coldstaked_balance{0};
CAmount shielded_balance{0};
Expand Down

0 comments on commit 0f197ca

Please sign in to comment.