-
Notifications
You must be signed in to change notification settings - Fork 94
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
fix(swaps): retry refund of maker swap v1 payment until successful #2132
base: dev
Are you sure you want to change the base?
Conversation
there are swaps that show this error on
wonder what will happen to those? will mm2 retry those indefinitely? this is the swap json from this swap on maker:
reason is that the to-be-refunded makerpayment never made it on to the blockchain, this tx does not exist on the explorer https://dogechain.info/chain/Dogecoin
or does mm2 not retry this kind of failed swaps? |
Yep, mm2 will retry those indefinitely, thanks for noticing this. We can't skip the refund stage in case the transaction is actually on chain but the wait for confirmation took too long (problems in block production for certain chains), I think I should add a step to check if the transaction is on chain before retrying to refund forever, this should solve most problems. |
The tx from the swap i posted didn't even made it to the chain. The maker payment tx does not exist on chain. mm2 still tried to refund it later. |
I understand, but this error komodo-defi-framework/mm2src/coins/utxo/rpc_clients.rs Lines 197 to 205 in df6ab98
{
"error" : "maker_swap:922] !wait for maker payment confirmations: rpc_clients:158] Waited too long until 1708809594 for transaction 96c3e5dd0e446d2ef59b89957ae7d0e9fc2e14d479a23b85ce73e0664daf2e5e to be confirmed 2 times"
} Which makes me think that this transaction made it but was deleted from the mempool due some reason or confirmed then got deleted due to a chain reorganization, that's why we have to try to refund transactions either way and never assume that it never made it. |
I think this error was returned just due to how |
@cipig said the transaction never made it to the chain and couldn't be refunded. |
yes, makerpayment can't be found on explorer... could be that it initially made it to mempool, but was never mined and got removed later (DOGE has problems with mempool anyway because it's getting spammed by thousands of transactions) |
It will not retry it since I will add a step to check if the transaction is on chain before starting the retry loop. |
… for all coins and then checked before retrying refunds
perfect here is another failed swap that could stay in the loop forever:
i mentioned the problem here: #1567 |
Related to #1941, #1703
More description will be added