-
Notifications
You must be signed in to change notification settings - Fork 229
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
Swap failed, then a few seconds later completed #756
Comments
did the swap complete? my guess is that it failed waiting for some tx, so it both failed and then went on to complete the atomic swap protocol by unwinding the atomic swap and then completed so this is maybe a bit unexpected, but an artifact of having 50+ possible failed messages to make sure that any problem is identified. |
According to the last message it appears to have completed. {
"uuid":"9201125e07d4e8a9a2bd24d7abcbb2872e2d77be0f5aea3c5f2d861b9fbf6c22",
"expiration":1523438135,
"tradeid":2450937681,
"requestid":523815073,
"quoteid":3270592855,
"iambob":0,
"Bgui":"",
"Agui":"hyperdex",
"gui":"hyperdex",
"bob":"CHIPS",
"srcamount":1.04265855,
"bobtxfee":0.0001,
"alice":"KMD",
"destamount":0.10037849,
"alicetxfee":0.00001,
"aliceid":"8164005029987024897",
"sentflags":[
"alicespend",
"bobpayment",
"alicepayment",
"bobdeposit",
"myfee"
],
"values":[
1.04275855,
0,
1.04285855,
0.10039849,
1.17319086,
0,
0.00012918,
0,
0,
0,
0
],
"result":"success",
"status":"finished",
"finishtime":1523422821,
"bobdeposit":"90c06678b8a59503cc8eb254cc157fd850f69645564b9412aa3452c0790e5ce8",
"alicepayment":"94298563a9c1b82398339a0c543cc2dbd910ca0b1f412789fd1c1592697f8a8f",
"bobpayment":"0142c02ced82b83e7759812032684647ff7ca5945c0de52989e2c92465e9972f",
"paymentspent":"d6f42cc13b1fdf4637459cca68917690e9b60c506a107f108e3d8a383b3006ed",
"Apaymentspent":"0000000000000000000000000000000000000000000000000000000000000000",
"depositspent":"0000000000000000000000000000000000000000000000000000000000000000",
"method":"tradestatus"
} Also, if the swap unwinds, do we get any extra TXIDs? Like the payments being sent back to the original address? Or is that not how it works? |
From alice point of view, this one did complete. It seems to be a rare edge case where it gets an error in one part, even while it completed in the other. Never seen it before, but of course it makes sense you run into it. i guess, this means some "failed" arent really failures. I guess the thing to do is to wait a bit, even after a failed message to see if it will end up completing. Horrible... but what else to do |
So did it not complete for bob too? If that's the case, what happened to bobs funds? Surely it either completed or it didn't, as it's an atomic operation.
This could potentially lead to memory leaks because we need to keep listening on all failed swaps to check if they eventually complete.
Can we not make the status atomic? It either fails or it doesn't. |
i guess its possible, but it wont be easy... bob's completion status is different from alice's as bob needs to do more things to undo a half started swap |
So how has it failed for bob? Did he not get his funds released? Is there any possibility of rolling back the trade? |
bob manages his side independently from alice, there is no indication that the swap failed. the failed message was a network comms issue, |
Ok, are you able to track down the communication issue and resolve it from the posted socket messages? We need to remove the swap listener from the socket message stream on failed event to avoid memory leaks. But currently that's not safe to do because in this scenario it will result in completed swaps listed as failed. |
could you delay the swap listener removal for 5 or 10 minutes? i fear messing with this could be like what happened with the orderbook/portfolio override. It just isnt designed for that. The failed messages are just posted to the event stream as you wanted all events. and here we have an event that is wrong... so what to do, we cant have the working swap fail just because there was a failed message. and we cant stop the failed message if there was a comms breakdown. really, i think it is best for the GUI to deal with this edge case of a false positive failed message. it doesnt happen that often and it seems like having an expiration time for the removal of the swap listner that is set 10 minutes in the future whenever there is any activity would solve your issue |
Ok, thanks for the explanation, will implement a 10 min delay before removing the event listener. |
I just did a swap that got a message saying it had failed, then a few seconds later a message saying it completed:
Check the last two messages.
The text was updated successfully, but these errors were encountered: