Arbitration broadcast DPT and dispute message in parallel.

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.
This commit is contained in:
jmacxx 2023-08-18 17:51:54 -05:00
parent a2dca3e4d4
commit 1a184a2e4f
No known key found for this signature in database
GPG Key ID: 155297BABFE94A1B

View File

@ -647,11 +647,10 @@ public class PendingTradesDataModel extends ActivatableDataModel {
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());
}