mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-10-01 01:35:48 -04:00
synchronize on wallet lock getting address entries
This commit is contained in:
parent
e2369480b2
commit
f9afd44345
@ -1026,15 +1026,17 @@ public class XmrWalletService {
|
||||
}
|
||||
|
||||
public List<XmrAddressEntry> getAddressEntryListAsImmutableList() {
|
||||
List<MoneroSubaddress> subaddresses = wallet.getSubaddresses(0);
|
||||
for (MoneroSubaddress subaddress : subaddresses) {
|
||||
boolean exists = xmrAddressEntryList.getAddressEntriesAsListImmutable().stream().filter(addressEntry -> addressEntry.getAddressString().equals(subaddress.getAddress())).findAny().isPresent();
|
||||
if (!exists) {
|
||||
XmrAddressEntry entry = new XmrAddressEntry(subaddress.getIndex(), subaddress.getAddress(), subaddress.getIndex() == 0 ? XmrAddressEntry.Context.BASE_ADDRESS : XmrAddressEntry.Context.AVAILABLE, null, null);
|
||||
xmrAddressEntryList.addAddressEntry(entry);
|
||||
synchronized (walletLock) {
|
||||
List<MoneroSubaddress> subaddresses = wallet.getSubaddresses(0);
|
||||
for (MoneroSubaddress subaddress : subaddresses) {
|
||||
boolean exists = xmrAddressEntryList.getAddressEntriesAsListImmutable().stream().filter(addressEntry -> addressEntry.getAddressString().equals(subaddress.getAddress())).findAny().isPresent();
|
||||
if (!exists) {
|
||||
XmrAddressEntry entry = new XmrAddressEntry(subaddress.getIndex(), subaddress.getAddress(), subaddress.getIndex() == 0 ? XmrAddressEntry.Context.BASE_ADDRESS : XmrAddressEntry.Context.AVAILABLE, null, null);
|
||||
xmrAddressEntryList.addAddressEntry(entry);
|
||||
}
|
||||
}
|
||||
return xmrAddressEntryList.getAddressEntriesAsListImmutable();
|
||||
}
|
||||
return xmrAddressEntryList.getAddressEntriesAsListImmutable();
|
||||
}
|
||||
|
||||
public List<XmrAddressEntry> getUnusedAddressEntries() {
|
||||
|
Loading…
Reference in New Issue
Block a user