If a refund action is present and it is possible to trigger it, do it, else, do the other available action.
Get inspired by comit-rs e2e tests.
The motivation is that if you reach a point where refund is possible we give up on the swap and do a refund. However the comit_node will return the refund action as soon as an asset is funded.
To know if refund is possible we need to check the blockchain times, this is done differently on different blockchains.
"it is possible to trigger it": you need to ask the blockchain node what time it is. Note that we use absolute unix time for expiry.
If the refund fails:
Bitcoind will (hopefully) tell you, so the actionExecutor can try again later. Check the wait time.
Ethereum will not tell you until comit-network/RFCs#62 (and the implementation) is done, for now, accept the money loss.
If a refund action is present and it is possible to trigger it, do it, else, do the other available action.
Get inspired by comit-rs e2e tests.
The motivation is that if you reach a point where refund is possible we give up on the swap and do a refund. However the comit_node will return the refund action as soon as an asset is funded. To know if refund is possible we need to check the blockchain times, this is done differently on different blockchains.
"it is possible to trigger it": you need to ask the blockchain node what time it is. Note that we use absolute unix time for expiry.
If the refund fails:
actionExecutor
can try again later. Check the wait time.