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

state : Cancel timelock is expired #709

Closed
fbion opened this issue Aug 30, 2021 · 15 comments · Fixed by #705
Closed

state : Cancel timelock is expired #709

fbion opened this issue Aug 30, 2021 · 15 comments · Fixed by #705
Labels
bug Something isn't working loss-of-funds Critical bug which can result in loss of funds

Comments

@fbion
Copy link

fbion commented Aug 30, 2021

Error: Failed to broadcast Bitcoin cancel transaction

Caused by:
Electrum(Protocol(String("sendrawtransaction RPC error: {"code":-26,"message":"non-BIP68-final"}")))

@fbion
Copy link
Author

fbion commented Aug 30, 2021

ERROR The cancel transaction cannot be published yet, because the timelock has not expired. Please try again later

@fbion
Copy link
Author

fbion commented Aug 30, 2021

2021-08-30 21:13:41 INFO Received new confirmation for Monero lock tx txid= seen_confirmations=7 needed_confirmations=10
2021-08-30 21:15:52 WARN Failed to get status of script: Failed to subscribe to header notifications: Made one or multiple attempts, all errored:
- CloseNotify alert received
txid=
Error: Failed to complete swap

Caused by:
0: Failed to broadcast Bitcoin cancel transaction
1: Electrum(Protocol(String("sendrawtransaction RPC error: {"code":-26,"message":"non-BIP68-final"}")))

@kirtspaulding
Copy link

kirtspaulding commented Aug 30, 2021

Hi I am having the same issue. Transaction was working properly and failed.

Error: Failed to broadcast Bitcoin cancel transaction ae3a078c9a626a3299d641fd98148a8ac07d0c6ba321ddea8b2b2e28942b49db

Caused by:
Electrum(Protocol(String("sendrawtransaction RPC error: {"code":-26,"message":"non-BIP68-final"}")))

Says I can't cancel because timelock hasn't expired? I can't resume the swap either.

my swap history shows
4a6bbdec-341b-4d18-bfef-b460a3050717 | Cancel timelock is expired

@devbordecraft
Copy link

devbordecraft commented Aug 30, 2021

Check this out :
https://sethforprivacy.com/guides/bitcoin-monero-atomic-swaps/#what-to-do-if-the-swap-fails

You can refund between 72 and 128 of your first bitcoin transaction @fbion @kirtspaulding

@kirtspaulding
Copy link

Check this out :
https://sethforprivacy.com/guides/bitcoin-monero-atomic-swaps/#what-to-do-if-the-swap-fails

You can refund between 72 and 128 of your first bitcoin transaction

Yep great, I need to wakeup at in the middle of the night to ensure I don't lose my money.

@devbordecraft
Copy link

Not necessarily, a 72 confirmation is about ~12hours.
Out of curiosity, what error message does it show to you when you try to resume?

@kirtspaulding
Copy link

kirtspaulding commented Aug 30, 2021

@devbordecraft

swaptool> ./swap.exe resume --swap-id 4a6bbdec-341b-4d18-bfef-b460a3050717

Error: Failed to broadcast Bitcoin cancel transaction ae3a078c9a626a3299d641fd98148a8ac07d0c6ba321ddea8b2b2e28942b49db

Caused by:
Electrum(Protocol(String("sendrawtransaction RPC error: {"code":-26,"message":"non-BIP68-final"}")))

Other details that may be relevant:

  • Was using a VPN at the time (US based)

  • Windows Powershell (Administrator) was not the active window (had it running in the background)
    i) This seems relevant as before the failure, it was showing 6 confirms for the monero, but when I clicked the screen a
    more stuff popped up and then it failed.

@devbordecraft
Copy link

Maybe it is related to this ?
https://medium.com/@harshg0910/click-to-pause-execution-in-windows-powershell-b451044501ac
If that's it, that would explain why the swap failed

@kirtspaulding
Copy link

@devbordecraft this is a great comment. I can't say if it's the right answer, but if clicking the session or clicking away causes issues... should be high priority for devs to investigate.

@devbordecraft
Copy link

Afaik this is a bug (or a feature ?) related to windows PowerShell, not the tool. PowerShell suspend any process in the console when the user select or highlight something in it

@rishflab
Copy link
Member

#705

2021-08-30 21:13:41 INFO Received new confirmation for Monero lock tx txid= seen_confirmations=7 needed_confirmations=10
2021-08-30 21:15:52 WARN Failed to get status of script: Failed to subscribe to header notifications: Made one or multiple attempts, all errored:

  • CloseNotify alert received
    txid=
    Error: Failed to complete swap

Caused by:
0: Failed to broadcast Bitcoin cancel transaction
1: Electrum(Protocol(String("sendrawtransaction RPC error: {"code":-26,"message":"non-BIP68-final"}")))

We think we have the error causing this and have a fix coming shortly #705

@rishflab rishflab linked a pull request Aug 31, 2021 that will close this issue
@rishflab rishflab added bug Something isn't working loss-of-funds Critical bug which can result in loss of funds labels Aug 31, 2021
@fbion
Copy link
Author

fbion commented Aug 31, 2021

./swap --debug cancel --swap-id **
Error: Cannot cancel swap ** because it is in state btc is cancelled which is not refundable.

./swap --debug refund --swap-id **
2021-08-31 08:38:24 Published Bitcoin transaction txid=** kind=refund
2021-08-31 08:38:24 Waiting for Bitcoin transaction finality txid=** required_confirmation=2
2021-08-31 08:42:28 Waiting for Bitcoin transaction finality txid=** seen_confirmations=2 needed_confirmations=2
Done: BtcRefunded

@nanostos
Copy link

I guess we can remove the loss-of-funds tag now. It's not a powershell issue. I've experienced the same exact problem on both Windows and Ubuntu.

@rishflab
Copy link
Member

Check this out :
https://sethforprivacy.com/guides/bitcoin-monero-atomic-swaps/#what-to-do-if-the-swap-fails
You can refund between 72 and 128 of your first bitcoin transaction

Yep great, I need to wakeup at in the middle of the night to ensure I don't lose my money.

Our intention was for the swap cli to wait until block 72 and do this for you but it is broken due a bug (which should be fixed with #705). Then you should be able to resume a swap (using cli args) and it should handle swap execution for you.

Manual cancel/refund is a temp fix until #705 is merged.

@kirtspaulding
Copy link

kirtspaulding commented Aug 31, 2021

Just tried this morning, cancel failed without force tag, but worked after force applied. Refund success.

./swap.exe cancel --swap-id 4a6bbdec-341b-4d18-bfef-b460a3050717
Manually cancelling swap swap_id=4a6bbdec-341b-4d18-bfef-b460a3050717
The cancel transaction cannot be published yet, because the timelock has not expired. Please try again later

./swap.exe cancel --force --swap-id 4a6bbdec-341b-4d18-bfef-b460a3050717
Manually cancelling swap swap_id=4a6bbdec-341b-4d18-bfef-b460a3050717

./swap.exe refund --swap-id 4a6bbdec-341b-4d18-bfef-b460a3050717
Published Bitcoin transaction txid=7d484067a13285e6638734bab99cbe495768479e7eff5a38f2642106245c4018 kind=refund

@fbion fbion closed this as completed Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working loss-of-funds Critical bug which can result in loss of funds
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants