cache txs fetched from daemon

This commit is contained in:
woodser 2022-08-15 01:50:05 -04:00
parent 54eee73c04
commit f9d700074a
3 changed files with 58 additions and 8 deletions

View file

@ -178,7 +178,7 @@ public class TxIdTextField extends AnchorPane {
private void updateConfidence(String txId) {
MoneroTx tx = null;
try {
tx = xmrWalletService.getDaemon().getTx(txId); // TODO: cache results and don't re-fetch
tx = xmrWalletService.getTxWithCache(txId);
tx.setNumConfirmations(tx.isConfirmed() ? xmrWalletService.getConnectionsService().getLastInfo().getHeight() - tx.getHeight() : 0l); // TODO: use tx.getNumConfirmations() when MoneroDaemonRpc supports it
} catch (Exception e) {
// do nothing