mirror of
https://github.com/retoaccess1/haveno-reto.git
synced 2024-11-10 05:03:35 +01:00
use wallet lock with xmr address entries
This commit is contained in:
parent
153f708a7c
commit
8776fecef0
@ -1206,9 +1206,11 @@ public class XmrWalletService {
|
||||
}
|
||||
|
||||
public List<XmrAddressEntry> getFundedAvailableAddressEntries() {
|
||||
synchronized (walletLock) {
|
||||
List<MoneroSubaddress> subaddresses = wallet.getSubaddresses(0);
|
||||
return getAvailableAddressEntries().stream().filter(addressEntry -> getBalanceForSubaddress(addressEntry.getSubaddressIndex(), subaddresses).compareTo(BigInteger.ZERO) > 0).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
public List<XmrAddressEntry> getAddressEntryListAsImmutableList() {
|
||||
synchronized (walletLock) {
|
||||
@ -1225,8 +1227,10 @@ public class XmrWalletService {
|
||||
}
|
||||
|
||||
public List<XmrAddressEntry> getUnusedAddressEntries() {
|
||||
synchronized (walletLock) {
|
||||
return getUnusedAddressEntries(getTxsWithIncomingOutputs(), wallet.getSubaddresses(0));
|
||||
}
|
||||
}
|
||||
|
||||
public List<XmrAddressEntry> getUnusedAddressEntries(List<MoneroTxWallet> cachedTxs, List<MoneroSubaddress> cachedSubaddresses) {
|
||||
return getAvailableAddressEntries().stream()
|
||||
@ -1338,6 +1342,7 @@ public class XmrWalletService {
|
||||
}
|
||||
|
||||
public Stream<XmrAddressEntry> getAddressEntriesForAvailableBalanceStream() {
|
||||
synchronized (walletLock) {
|
||||
Stream<XmrAddressEntry> available = getFundedAvailableAddressEntries().stream();
|
||||
available = Stream.concat(available, getAddressEntries(XmrAddressEntry.Context.ARBITRATOR).stream());
|
||||
available = Stream.concat(available, getAddressEntries(XmrAddressEntry.Context.OFFER_FUNDING).stream().filter(entry -> !tradeManager.getOpenOfferManager().getOpenOfferById(entry.getOfferId()).isPresent()));
|
||||
@ -1345,6 +1350,7 @@ public class XmrWalletService {
|
||||
List<MoneroSubaddress> subaddresses = wallet.getSubaddresses(0);
|
||||
return available.filter(addressEntry -> getBalanceForSubaddress(addressEntry.getSubaddressIndex(), subaddresses).compareTo(BigInteger.ZERO) > 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void addWalletListener(MoneroWalletListenerI listener) {
|
||||
synchronized (walletListeners) {
|
||||
|
Loading…
Reference in New Issue
Block a user