mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-01-03 17:40:10 +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);
|
||||
|
||||
// reset offer funding address entry if unused
|
||||
List<MoneroOutputWallet> inputs = model.getXmrWalletService().getOutputs(reservedKeyImages);
|
||||
boolean usesFundingEntry = false;
|
||||
for (MoneroOutputWallet input : inputs) {
|
||||
if (input.getAccountIndex() == 0 && input.getSubaddressIndex() == fundingEntry.getSubaddressIndex()) {
|
||||
usesFundingEntry = true;
|
||||
break;
|
||||
if (fundingEntry != null) {
|
||||
List<MoneroOutputWallet> inputs = model.getXmrWalletService().getOutputs(reservedKeyImages);
|
||||
boolean usesFundingEntry = false;
|
||||
for (MoneroOutputWallet input : inputs) {
|
||||
if (input.getAccountIndex() == 0 && input.getSubaddressIndex() == fundingEntry.getSubaddressIndex()) {
|
||||
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();
|
||||
} catch (Throwable t) {
|
||||
|
|
Loading…
Reference in a new issue