mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-14 09:25:37 -04:00
use more cached wallet state instead of direct queries
This commit is contained in:
parent
a5883d7bcd
commit
e96b875232
7 changed files with 18 additions and 15 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue