MCPcopy Create free account
hub / github.com/LUX-Core/lux / refreshWallet

Method refreshWallet

src/qt/tokentransactiontablemodel.cpp:75–91  ·  view source on GitHub ↗

Query entire wallet anew from core. */

Source from the content-addressed store, hash-verified

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.

Callers 1

Calls 6

AddTokenTxEntryMethod · 0.80
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetBlockTimeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected