MCPcopy Create free account
hub / github.com/ElementsProject/elements / index

Method index

src/qt/transactiontablemodel.cpp:219–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217 }
218
219 TransactionRecord* index(interfaces::Wallet& wallet, const uint256& cur_block_hash, const int idx)
220 {
221 if (idx >= 0 && idx < cachedWallet.size()) {
222 TransactionRecord *rec = &cachedWallet[idx];
223
224 // If a status update is needed (blocks came in since last check),
225 // try to update the status of this transaction from the wallet.
226 // Otherwise, simply re-use the cached status.
227 interfaces::WalletTxStatus wtx;
228 int numBlocks;
229 int64_t block_time;
230 if (!cur_block_hash.IsNull() && rec->statusUpdateNeeded(cur_block_hash) && wallet.tryGetTxStatus(rec->hash, wtx, numBlocks, block_time)) {
231 rec->updateStatus(wtx, cur_block_hash, numBlocks, block_time);
232 }
233 return rec;
234 }
235 return nullptr;
236 }
237
238 QString describe(interfaces::Node& node, interfaces::Wallet& wallet, TransactionRecord *rec, int unit)
239 {

Callers

nothing calls this directly

Calls 5

statusUpdateNeededMethod · 0.80
tryGetTxStatusMethod · 0.80
sizeMethod · 0.45
IsNullMethod · 0.45
updateStatusMethod · 0.45

Tested by

no test coverage detected