| 177 | } |
| 178 | |
| 179 | TransactionRecord *index(interfaces::Wallet& wallet, int idx) |
| 180 | { |
| 181 | if(idx >= 0 && idx < cachedWallet.size()) |
| 182 | { |
| 183 | TransactionRecord *rec = &cachedWallet[idx]; |
| 184 | |
| 185 | // Get required locks upfront. This avoids the GUI from getting |
| 186 | // stuck if the core is holding the locks for a longer time - for |
| 187 | // example, during a wallet rescan. |
| 188 | // |
| 189 | // If a status update is needed (blocks came in since last check), |
| 190 | // update the status of this transaction from the wallet. Otherwise, |
| 191 | // simply re-use the cached status. |
| 192 | interfaces::WalletTxStatus wtx; |
| 193 | int numBlocks; |
| 194 | int64_t adjustedTime; |
| 195 | if (wallet.tryGetTxStatus(rec->hash, wtx, numBlocks, adjustedTime) && rec->statusUpdateNeeded(numBlocks)) { |
| 196 | rec->updateStatus(wtx, numBlocks, adjustedTime); |
| 197 | } |
| 198 | return rec; |
| 199 | } |
| 200 | return 0; |
| 201 | } |
| 202 | |
| 203 | QString describe(interfaces::Node& node, interfaces::Wallet& wallet, TransactionRecord *rec, int unit) |
| 204 | { |
nothing calls this directly
no test coverage detected