Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid case of multi trades with same offer #4889

Conversation

chimp1984
Copy link
Contributor

Fixes #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.

fails early that we get another trade with same id at maker in case another use takes the offer afterwards.
fail in case of multiple trades with the same offer id.
Use uid instead of the weaker offerId as key for the tradeProtocolByTradeId map
Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@sqrrm sqrrm merged commit 5768124 into bisq-network:hotfix/v1.5.1 Dec 3, 2020
@chimp1984 chimp1984 deleted the avoid-case-of-multi-trades-with-same-offer-id branch December 4, 2020 16:31
@ripcurlx ripcurlx added this to the 1.5.1 milestone Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants