| 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 | { |
nothing calls this directly
no test coverage detected