mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-22 20:19:21 +00:00
improve error handling on payment received message (#1327)
This commit is contained in:
parent
a6c178c058
commit
e811e2b224
1 changed files with 10 additions and 10 deletions
|
@ -161,11 +161,11 @@ public class ProcessPaymentReceivedMessage extends TradeTask {
|
||||||
|
|
||||||
// verify and publish payout tx
|
// verify and publish payout tx
|
||||||
if (!trade.isPayoutPublished()) {
|
if (!trade.isPayoutPublished()) {
|
||||||
if (isSigned) {
|
try {
|
||||||
log.info("{} {} publishing signed payout tx from seller", trade.getClass().getSimpleName(), trade.getId());
|
if (isSigned) {
|
||||||
trade.processPayoutTx(message.getSignedPayoutTxHex(), false, true);
|
log.info("{} {} publishing signed payout tx from seller", trade.getClass().getSimpleName(), trade.getId());
|
||||||
} else {
|
trade.processPayoutTx(message.getSignedPayoutTxHex(), false, true);
|
||||||
try {
|
} else {
|
||||||
PaymentSentMessage paymentSentMessage = (trade.isArbitrator() ? trade.getBuyer() : trade.getArbitrator()).getPaymentSentMessage();
|
PaymentSentMessage paymentSentMessage = (trade.isArbitrator() ? trade.getBuyer() : trade.getArbitrator()).getPaymentSentMessage();
|
||||||
if (paymentSentMessage == null) throw new RuntimeException("Process model does not have payment sent message for " + trade.getClass().getSimpleName() + " " + trade.getId());
|
if (paymentSentMessage == null) throw new RuntimeException("Process model does not have payment sent message for " + trade.getClass().getSimpleName() + " " + trade.getId());
|
||||||
if (trade.getPayoutTxHex() == null) { // unsigned
|
if (trade.getPayoutTxHex() == null) { // unsigned
|
||||||
|
@ -175,12 +175,12 @@ public class ProcessPaymentReceivedMessage extends TradeTask {
|
||||||
log.info("{} {} re-verifying and publishing signed payout tx", trade.getClass().getSimpleName(), trade.getId());
|
log.info("{} {} re-verifying and publishing signed payout tx", trade.getClass().getSimpleName(), trade.getId());
|
||||||
trade.processPayoutTx(trade.getPayoutTxHex(), false, true);
|
trade.processPayoutTx(trade.getPayoutTxHex(), false, true);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
|
||||||
HavenoUtils.waitFor(trade.getXmrConnectionService().getRefreshPeriodMs()); // wait to see published tx
|
|
||||||
trade.syncAndPollWallet();
|
|
||||||
if (trade.isPayoutPublished()) log.info("Payout tx already published for {} {}", trade.getClass().getName(), trade.getId());
|
|
||||||
else throw e;
|
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
HavenoUtils.waitFor(trade.getXmrConnectionService().getRefreshPeriodMs()); // wait to see published tx
|
||||||
|
trade.syncAndPollWallet();
|
||||||
|
if (trade.isPayoutPublished()) log.info("Payout tx already published for {} {}", trade.getClass().getName(), trade.getId());
|
||||||
|
else throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue