Query entire wallet anew from core. */
| 73 | /* Query entire wallet anew from core. |
| 74 | */ |
| 75 | void refreshWallet() { |
| 76 | qDebug() << "TokenTransactionTablePriv::refreshWallet"; |
| 77 | cachedWallet.clear();{ |
| 78 | LOCK2(cs_main, wallet->cs_wallet); |
| 79 | for(std::map<uint256, CTokenTx>::iterator it = wallet->mapTokenTx.begin(); it != wallet->mapTokenTx.end(); ++it) { |
| 80 | // Update token transaction time if the block time is changed |
| 81 | CTokenTx wtokenTx = it->second; |
| 82 | const CBlockIndex *pIndex = chainActive[wtokenTx.blockNumber]; |
| 83 | if(pIndex && pIndex->GetBlockTime() != wtokenTx.nCreateTime) { |
| 84 | wtokenTx.nCreateTime = pIndex->GetBlockTime(); |
| 85 | wallet->AddTokenTxEntry(wtokenTx, false); |
| 86 | } |
| 87 | // Add token tx to the cache |
| 88 | cachedWallet.append(TokenTransactionRecord::decomposeTransaction(wallet, wtokenTx)); |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | /* Update our model of the wallet incrementally, to synchronize our model of the wallet |
| 94 | with that of the core. |
no test coverage detected