diff --git a/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java b/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java index 520e2ee1..6c864adb 100644 --- a/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java +++ b/core/src/main/java/haveno/core/xmr/wallet/XmrWalletService.java @@ -844,9 +844,14 @@ public class XmrWalletService { public synchronized XmrAddressEntry getNewAddressEntry(String offerId, XmrAddressEntry.Context context) { // try to use available and not yet used entries - List incomingTxs = getIncomingTxs(); // prefetch all incoming txs to avoid query per subaddress - Optional emptyAvailableAddressEntry = getAddressEntryListAsImmutableList().stream().filter(e -> XmrAddressEntry.Context.AVAILABLE == e.getContext()).filter(e -> isSubaddressUnused(e.getSubaddressIndex(), incomingTxs)).findAny(); - if (emptyAvailableAddressEntry.isPresent()) return xmrAddressEntryList.swapAvailableToAddressEntryWithOfferId(emptyAvailableAddressEntry.get(), context, offerId); + try { + List incomingTxs = getIncomingTxs(); // prefetch all incoming txs to avoid query per subaddress + Optional emptyAvailableAddressEntry = getAddressEntryListAsImmutableList().stream().filter(e -> XmrAddressEntry.Context.AVAILABLE == e.getContext()).filter(e -> isSubaddressUnused(e.getSubaddressIndex(), incomingTxs)).findAny(); + if (emptyAvailableAddressEntry.isPresent()) return xmrAddressEntryList.swapAvailableToAddressEntryWithOfferId(emptyAvailableAddressEntry.get(), context, offerId); + } catch (Exception e) { + log.warn("Error getting new address entriy based on incoming transactions"); + e.printStackTrace(); + } // create new subaddress and entry MoneroSubaddress subaddress = wallet.createSubaddress(0);