[bisq-network/bisq] Avoid case of multi trades with same offer (#4889)

chimp1984 notifications at github.com
Thu Dec 3 20:51:31 CET 2020


Fixes https://github.com/bisq-network/bisq/issues/4879

We had removed the offer after the first trade task. If it failed there the offer stayed online and could be taken by another user. This caused the issue that one failed trade was in the trade list and then later a valid trade entered as well. As we used the offerId as key for a map which was used for the processModel lookup, that caused a bug with a Nullpointer exception.

This PR fixes that problem by using a uid instead of the offerId to make the map lookup more solid.
It also moves the task to remove the offer as the very first task so it cannot happen anymore that a offer stays online and leads later to 2 trades with the same offer id.

It also increased the realtively short timeout of 30 seconds in the some trade protocol task runners. We saw some cases where those timeouts triggered errorMessages but the trade could complete without problem, so that should help to reduce such cases. We do not fail on those timeouts, they only trigger an error message. The general trade protocol timeout would cause a failure of the trade.


You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/4889

-- Commit Summary --

  * Increase timeout for trade protocol task runners from 30 to 60 sec
  * Move MakerRemovesOpenOffer to first task to avoid that if take offer
  * Add uid to trade to make sure that look up for process model cannot

-- File Changes --

    M core/src/main/java/bisq/core/trade/BuyerAsMakerTrade.java (17)
    M core/src/main/java/bisq/core/trade/BuyerAsTakerTrade.java (17)
    M core/src/main/java/bisq/core/trade/BuyerTrade.java (12)
    M core/src/main/java/bisq/core/trade/SellerAsMakerTrade.java (17)
    M core/src/main/java/bisq/core/trade/SellerAsTakerTrade.java (17)
    M core/src/main/java/bisq/core/trade/SellerTrade.java (12)
    M core/src/main/java/bisq/core/trade/Trade.java (20)
    M core/src/main/java/bisq/core/trade/TradeManager.java (35)
    M core/src/main/java/bisq/core/trade/protocol/BuyerAsMakerProtocol.java (6)
    M core/src/main/java/bisq/core/trade/protocol/BuyerAsTakerProtocol.java (6)
    M core/src/main/java/bisq/core/trade/protocol/SellerAsMakerProtocol.java (6)
    M core/src/main/java/bisq/core/trade/protocol/SellerAsTakerProtocol.java (4)
    M proto/src/main/proto/pb.proto (1)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/4889.patch
https://github.com/bisq-network/bisq/pull/4889.diff

-- 
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/pull/4889
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20201203/e815e5dd/attachment.htm>


More information about the bisq-github mailing list