Skip to content

Commit 87ce137

Browse files
committed
recover when offer reserve tx is invalidated by reorg
1 parent 0f560cc commit 87ce137

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

core/src/main/java/haveno/core/offer/OpenOfferManager.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,17 +1224,21 @@ private MoneroTxWallet getSplitOutputFundingTx(List<OpenOffer> openOffers, OpenO
12241224
MoneroTxWallet splitOutputTx = xmrWalletService.getTx(openOffer.getSplitOutputTxHash());
12251225

12261226
// check if split output tx is available for offer
1227-
if (splitOutputTx.isLocked()) return splitOutputTx;
1228-
else {
1229-
boolean isAvailable = true;
1230-
for (MoneroOutputWallet output : splitOutputTx.getOutputsWallet()) {
1231-
if (output.isSpent() || output.isFrozen()) {
1232-
isAvailable = false;
1233-
break;
1227+
if (splitOutputTx != null) {
1228+
if (splitOutputTx.isLocked()) return splitOutputTx;
1229+
else {
1230+
boolean isAvailable = true;
1231+
for (MoneroOutputWallet output : splitOutputTx.getOutputsWallet()) {
1232+
if (output.isSpent() || output.isFrozen()) {
1233+
isAvailable = false;
1234+
break;
1235+
}
12341236
}
1237+
if (isAvailable || isReservedByOffer(openOffer, splitOutputTx)) return splitOutputTx;
1238+
else log.warn("Split output tx {} is no longer available for offer {}", openOffer.getSplitOutputTxHash(), openOffer.getId());
12351239
}
1236-
if (isAvailable || isReservedByOffer(openOffer, splitOutputTx)) return splitOutputTx;
1237-
else log.warn("Split output tx is no longer available for offer {}", openOffer.getId());
1240+
} else {
1241+
log.warn("Split output tx {} no longer exists for offer {}", openOffer.getSplitOutputTxHash(), openOffer.getId());
12381242
}
12391243
}
12401244

desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionsListItem.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,6 @@ private LazyFields lazy() {
170170
}
171171
}
172172
}
173-
} else {
174-
if (amount.compareTo(BigInteger.ZERO) == 0) {
175-
details = Res.get("funds.tx.noFundsFromDispute");
176-
}
177173
}
178174

179175
// get tx date/time

0 commit comments

Comments
 (0)