Skip to content

Commit

Permalink
Arbitration broadcast DPT and dispute message in parallel.
Browse files Browse the repository at this point in the history
Previously the dispute message would only be sent once the DPT had
finished propagation.  To a user it would appear as if nothing
happened and they would attempt to initiate the process again.
That would cause the DPT logic to fail (we already have an
open timer etc..) and the logic failing would result in no
happy path therefore no Dispute message being sent.

Testing confirmed there is no requirement for the dispute to be
chained on the successful propagation of the DPT to nodes.
Both the DPT and the dispute can be attempted again by the user
if necessary.  Rebroadcasting an already published DPT causes
no harm.  Re-sending the dispute message also causes no harm
as there is logic to detect if it already exists and handle it
gracefully.
  • Loading branch information
jmacxx committed Aug 18, 2023
1 parent a2dca3e commit 1a184a2
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -647,11 +647,10 @@ private void doOpenDispute(boolean isSupportTicket, Transaction depositTx) {
dispute.setBurningManSelectionHeight(trade.getProcessModel().getBurningManSelectionHeight());
dispute.setTradeTxFee(trade.getTradeTxFeeAsLong());

((DisputeProtocol) tradeManager.getTradeProtocol(trade)).onPublishDelayedPayoutTx(() -> {
log.info("DelayedPayoutTx published and message sent to peer");
sendOpenDisputeMessage(disputeManager, resultHandler, dispute);
},
((DisputeProtocol) tradeManager.getTradeProtocol(trade)).onPublishDelayedPayoutTx(
() -> log.info("DelayedPayoutTx published and message sent to peer"),
errorMessage -> new Popup().error(errorMessage).show());
sendOpenDisputeMessage(disputeManager, resultHandler, dispute);
} else {
log.warn("Invalid dispute state {}", disputeState.name());
}
Expand Down

0 comments on commit 1a184a2

Please sign in to comment.