spesmilo / electrum

Electrum Bitcoin Wallet
https://electrum.org
MIT License
7.38k stars 3.07k forks source link

TrustedCoinException code 2fa an error occurs. #8756

Open faemetcarip opened 9 months ago

faemetcarip commented 9 months ago

Hello, I have a frozen transaction and I am trying to cancel it with double spend. When I enter the code 2fa an error occurs.

trustedcoins

TrustedCoinException('\n    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\n    <html>\n        <head>\n            <title>Error: 402 Payment Required</title>\n            <style type="text/css">\n              html {background-color: #eee; font-family: sans;}\n              body {background-color: #fff; border: 1px solid #ddd;\n                    padding: 15px; margin: 15px;}\n              pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}\n            </style>\n        </head>\n        <body>\n            <h1>Error: 402 Payment Required</h1>\n            <p>Sorry, the requested URL <tt>&#039;https://api.trustedcoin.com/2/cosigner/d238d69fa50fa440ba6d7789dd4cdd511ffbc294b4e05b55d6319704f9631494/sign&#039;</tt>\n               caused an error:</p>\n            <pre>payment required</pre>\n        </body>\n    </html>\n')
SomberNight commented 9 months ago

Can you share the txid of the tx you are trying to cancel?

faemetcarip commented 9 months ago

Can you share the txid of the tx you are trying to cancel?

6b80e9611eb1b3872a7a0fe1a21804c4028f56a89950709d10b5064efe9bbf39

SomberNight commented 9 months ago

Thx. So the tx does not have a 2fa fee output.

In the bottom right of the main window, click the shield icon ("TrustedCoin"). In the bottom of the dialog that opens, it should say "Your wallet has {} prepaid transactions.". What does it say, how many "prepaid transactions" are there?

faemetcarip commented 9 months ago

Thx. So the tx does not have a 2fa fee output.

In the bottom right of the main window, click the shield icon ("TrustedCoin"). In the bottom of the dialog that opens, it should say "Your wallet has {} prepaid transactions.". What does it say, how many "prepaid transactions" are there?

изображение_2023-12-17_190428380

SomberNight commented 9 months ago

Ok, so the wallet has run out of prepaid txs after broadcasting the original tx. Now that you are trying to cancel it, the 2fa server is treating the replacement tx as a new one, and seeing the wallet has 0 prepaid txs, the server is expecting a 2fa fee output. But the client code treats the double-spend-cancel as a special case and does not add the 2fa fee output. Looks like a bug.


As a workaround, if you create a new tx, that would have the 2fa fee output added, paying for 20 more "prepaid transaction", after which the original tx you are trying to cancel could be cancelled.

As another workaround, you could restore from seed words, disable 2fa, and cancel the tx without the cooperation of the server.

faemetcarip commented 9 months ago

Thank you very much I will try to create a new tx, if it doesn't work I will do it the second way. thank you for your help.

faemetcarip commented 9 months ago

Ok, so the wallet has run out of prepaid txs after broadcasting the original tx. Now that you are trying to cancel it, the 2fa server is treating the replacement tx as a new one, and seeing the wallet has 0 prepaid txs, the server is expecting a 2fa fee output. But the client code treats the double-spend-cancel as a special case and does not add the 2fa fee output. Looks like a bug.

As a workaround, if you create a new tx, that would have the 2fa fee output added, paying for 20 more "prepaid transaction", after which the original tx you are trying to cancel could be cancelled.

As another workaround, you could restore from seed words, disable 2fa, and cancel the tx without the cooperation of the server.

Creating a new tx did not help. The second point with disabling trustedcoin solved the problem, transaction double spend. all good thanks