[bisq-network/bisq-core] Ack messages for all trade, offer- and dispute messages (#123)

Manfred Karrer notifications at github.com
Tue Jun 26 19:45:13 UTC 2018


ManfredKarrer commented on this pull request.



> -                        payoutTx = tradeOptional.get().getPayoutTx();
-                    } else {
-                        final Optional<Tradable> tradableOptional = closedTradableManager.getTradableById(tradeId);
-                        if (tradableOptional.isPresent() && tradableOptional.get() instanceof Trade) {
-                            payoutTx = ((Trade) tradableOptional.get()).getPayoutTx();
-                        }
+        final String tradeId = disputeResult.getTradeId();
+        Optional<Dispute> disputeOptional = findDispute(tradeId, disputeResult.getTraderId());
+        final String uid = disputeResultMessage.getUid();
+        if (!disputeOptional.isPresent()) {
+            log.debug("We got a dispute result msg but we don't have a matching dispute. " +
+                    "That might happen when we get the disputeResultMessage before the dispute was created. " +
+                    "We try again after 2 sec. to apply the disputeResultMessage. TradeId = " + tradeId);
+            if (!delayMsgMap.containsKey(uid)) {
+                // We delay2 sec. to be sure the comm. msg gets added first
+                Timer timer = UserThread.runAfter(() -> onDisputeResultMessage(disputeResultMessage), 2);

The delayMsgMap is use to prevent the infinite recursion. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq-core/pull/123#discussion_r198273880
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20180626/8aea1b59/attachment.html>


More information about the bisq-github mailing list