mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-01-20 17:54:39 +00:00
fix npe accessing funding address entry from api
Some checks failed
Codacy Coverage Reporter / Publish coverage (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / build (macos-13) (push) Has been cancelled
CI / build (ubuntu-22.04) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
Some checks failed
Codacy Coverage Reporter / Publish coverage (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / build (macos-13) (push) Has been cancelled
CI / build (ubuntu-22.04) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
This commit is contained in:
parent
cccd9cf094
commit
fc1388d2f4
1 changed files with 9 additions and 7 deletions
|
@ -124,15 +124,17 @@ public class MakerReserveOfferFunds extends Task<PlaceOfferModel> {
|
||||||
offer.getOfferPayload().setReserveTxKeyImages(reservedKeyImages);
|
offer.getOfferPayload().setReserveTxKeyImages(reservedKeyImages);
|
||||||
|
|
||||||
// reset offer funding address entry if unused
|
// reset offer funding address entry if unused
|
||||||
List<MoneroOutputWallet> inputs = model.getXmrWalletService().getOutputs(reservedKeyImages);
|
if (fundingEntry != null) {
|
||||||
boolean usesFundingEntry = false;
|
List<MoneroOutputWallet> inputs = model.getXmrWalletService().getOutputs(reservedKeyImages);
|
||||||
for (MoneroOutputWallet input : inputs) {
|
boolean usesFundingEntry = false;
|
||||||
if (input.getAccountIndex() == 0 && input.getSubaddressIndex() == fundingEntry.getSubaddressIndex()) {
|
for (MoneroOutputWallet input : inputs) {
|
||||||
usesFundingEntry = true;
|
if (input.getAccountIndex() == 0 && input.getSubaddressIndex() == fundingEntry.getSubaddressIndex()) {
|
||||||
break;
|
usesFundingEntry = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (!usesFundingEntry) model.getXmrWalletService().swapAddressEntryToAvailable(offer.getId(), XmrAddressEntry.Context.OFFER_FUNDING);
|
||||||
}
|
}
|
||||||
if (!usesFundingEntry) model.getXmrWalletService().swapAddressEntryToAvailable(offer.getId(), XmrAddressEntry.Context.OFFER_FUNDING);
|
|
||||||
}
|
}
|
||||||
complete();
|
complete();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
|
Loading…
Reference in a new issue