use more cached wallet state instead of direct queries

This commit is contained in:
woodser 2024-05-02 08:55:55 -04:00
parent a5883d7bcd
commit e96b875232
7 changed files with 18 additions and 15 deletions

View file

@ -1140,6 +1140,10 @@ public class XmrWalletService {
xmrAddressEntryList.requestPersistence();
}
public long getHeight() {
return walletHeight.get();
}
public List<MoneroTxWallet> getTxs(boolean includeFailed) {
List<MoneroTxWallet> txs = getTxs();
if (includeFailed) return txs;
@ -1158,6 +1162,10 @@ public class XmrWalletService {
return cachedTxs.stream().filter(tx -> query.meetsCriteria(tx)).collect(Collectors.toList());
}
public List<MoneroTxWallet> getTxs(List<String> txIds) {
return getTxs(new MoneroTxQuery().setHashes(txIds));
}
public MoneroTxWallet getTx(String txId) {
List<MoneroTxWallet> txs = getTxs(new MoneroTxQuery().setHash(txId));
return txs.isEmpty() ? null : txs.get(0);