| 67 | } |
| 68 | |
| 69 | void 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 | |
| 94 | void WalletModel::checkBalanceChanged(const interfaces::WalletBalances& new_balances) |
| 95 | { |
nothing calls this directly
no test coverage detected