MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / pollBalanceChanged

Method pollBalanceChanged

src/qt/walletmodel.cpp:69–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void WalletModel::pollBalanceChanged()
70{
71 // Try to get balances and return early if locks can't be acquired. This
72 // avoids the GUI from getting stuck on periodical polls if the core is
73 // holding the locks for a longer time - for example, during a wallet
74 // rescan.
75 interfaces::WalletBalances new_balances;
76 int numBlocks = -1;
77 if (!m_wallet->tryGetBalances(new_balances, numBlocks)) {
78 return;
79 }
80
81 if(fForceCheckBalanceChanged || m_node.getNumBlocks() != cachedNumBlocks)
82 {
83 fForceCheckBalanceChanged = false;
84
85 // Balance and number of transactions might have changed
86 cachedNumBlocks = m_node.getNumBlocks();
87
88 checkBalanceChanged(new_balances);
89 if(transactionTableModel)
90 transactionTableModel->updateConfirmations();
91 }
92}
93
94void WalletModel::checkBalanceChanged(const interfaces::WalletBalances& new_balances)
95{

Callers

nothing calls this directly

Calls 3

tryGetBalancesMethod · 0.80
getNumBlocksMethod · 0.80
updateConfirmationsMethod · 0.80

Tested by

no test coverage detected