Fix failed trade / missing payment information #5679
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem description:
A trade will fail if the deposit transaction is received via the mempool before it is received via P2P messaging protocols.
During initial trade protocol messaging, the deposit transaction is received at the buyer via two possible paths: a P2P message
DepositTxAndDelayedPayoutTxMessage
, or received in the mempool.Receiving via P2P message is much more likely, but in rare cases when received via the mempool first, we get the following error:
Log of broken version:
The handling of the P2P message is not carried out because it erroneously thinks it has been handled before. The preconditions are incorrect.
Preconditions are changed via this PR, checking if the payment account payload has already been received. If not, then the P2P message will be processed.
Log of fixed version:
This PR was a collaboration between myself (analysis & test), and @chimp1984 (suggested code fix).
The problem has been replicated on mainnet, and the fix tested on mainnet.