Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletmodel.cpp
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | if (cachedEncryptionStatus != newEncryptionStatus) { | ||||
Q_EMIT encryptionStatusChanged(); | Q_EMIT encryptionStatusChanged(); | ||||
} | } | ||||
} | } | ||||
void WalletModel::pollBalanceChanged() { | void WalletModel::pollBalanceChanged() { | ||||
// Avoid recomputing wallet balances unless a TransactionChanged or | // Avoid recomputing wallet balances unless a TransactionChanged or | ||||
// BlockTip notification was received. | // BlockTip notification was received. | ||||
if (!fForceCheckBalanceChanged && | if (!fForceCheckBalanceChanged && | ||||
m_cached_last_update_tip == m_client_model->getBestBlockHash()) { | m_cached_last_update_tip == getLastBlockProcessed()) { | ||||
return; | return; | ||||
} | } | ||||
// Try to get balances and return early if locks can't be acquired. This | // Try to get balances and return early if locks can't be acquired. This | ||||
// avoids the GUI from getting stuck on periodical polls if the core is | // avoids the GUI from getting stuck on periodical polls if the core is | ||||
// holding the locks for a longer time - for example, during a wallet | // holding the locks for a longer time - for example, during a wallet | ||||
// rescan. | // rescan. | ||||
interfaces::WalletBalances new_balances; | interfaces::WalletBalances new_balances; | ||||
▲ Show 20 Lines • Show All 442 Lines • ▼ Show 20 Lines | |||||
bool WalletModel::isMultiwallet() { | bool WalletModel::isMultiwallet() { | ||||
return m_node.getWallets().size() > 1; | return m_node.getWallets().size() > 1; | ||||
} | } | ||||
const CChainParams &WalletModel::getChainParams() const { | const CChainParams &WalletModel::getChainParams() const { | ||||
return Params(); | return Params(); | ||||
} | } | ||||
BlockHash WalletModel::getLastBlockProcessed() const { | |||||
return m_client_model ? m_client_model->getBestBlockHash() : BlockHash{}; | |||||
} |