Bitcoin Forum

Bitcoin => Electrum => Topic started by: jooray on December 08, 2020, 12:51:38 PM



Title: Cannot send TX - deadlock after pressing Pay
Post by: jooray on December 08, 2020, 12:51:38 PM
I have Electrum 4.0.6 (same problem with 4.0.5). I have three inputs, but one of them is small (0.0003 BTC). I want to spend all of them with 1sat/vB (I don't mind waiting), consolidating them into one UTXO.

The problem is that when I enter an address, click "Max" and "Pay", I get a popup "Preparing transaction", then it disappears and electrum freezes. The problem is with the small input (when I only click the other two inputs in coin control tab and click spend, the transaction is prepared).

I guess that Electrum is in a loop, because the fee estimator cannot spend the input according to the default fee (which I want to change later, but I don't see the window). Is there a way to change the default fee somehow from console? Or is there a way around freezing electrum in this edge case?

Thank you.


Title: Re: Cannot send TX - deadlock after pressing Pay
Post by: jackg on December 08, 2020, 01:25:27 PM
How much is in the small input and how much is the fee you're trying to spend?

Can you click perview/advanced and see if it'll build the transaction for you in that window?

I think there's an option in file > preferences > fees to enable manual fee setting.


Title: Re: Cannot send TX - deadlock after pressing Pay
Post by: ranochigo on December 08, 2020, 01:37:56 PM
I think there's an option in file > preferences > fees to enable manual fee setting.
The manual fee option is shifted to the dialog that is shown after the user presses Pay in the later versions. I don't think there's any preset fees and the user has to choose it at the point of the transaction.


Electrum shouldn't freeze when processing small inputs because it has no reason to. Can you go to Tools>Preferences and check Write Logs to files? Do the transaction again to make Electrum freeze and go to %appdata%/Electrum/Logs and paste the latest logs here.

Anyways, the only option I see fit if Electrum is unusable is that you can try to import to another compatible wallet or create a raw transaction using Coinb.in. I think latter is still viable since Electrum will show you the transaction information when you try to sign it.


Title: Re: Cannot send TX - deadlock after pressing Pay
Post by: jooray on December 08, 2020, 02:28:12 PM
jackg: In latest Electrum, you cannot choose fee before, only after you click Pay, in a dialog that I never see.

ranochigo: Logs say nothing, this is the whole log after attempting to create the transaction:

20201208T141303.424938Z |     INFO | network | fee_histogram [[95.9, 103099], [80.9, 110213], [71.3, 123499], [68.5, 174551], [61.0, 147077], [53.4, 161427], [36.1, 178882], [26.2, 197312], [23.0, 223641], [21.1, 303774], [20.1, 197957], [20.0, 748258], [15.8, 313896], [10.9, 350923], [8.9, 410955], [6.1, 436814], [5.0, 780269], [4.0, 642323], [3.1, 217826], [3.0, 1511159], [1.1, 1136504]]
20201208T141303.795518Z |     INFO | interface.[electrum.coinext.com.br:50002] | connection established. version: ['ElectrumX 1.14.0', '1.4']
20201208T141304.027405Z |     INFO | interface.[electrum.coinext.com.br:50002] | set blockchain with height 660500
20201208T141304.027782Z |     INFO | interface.[electrum.coinext.com.br:50002] | skipping header 660500
20201208T141304.037840Z |     INFO | network | fee_estimates {25: 21106, 10: 68310, 5: 68310, 2: 68310}
20201208T141304.290057Z |     INFO | network | fee_estimates {25: 21106, 10: 68310, 5: 68310, 2: 68310}
20201208T141304.323981Z |     INFO | network | fee_estimates {25: 21106, 10: 68310, 5: 68310, 2: 68310}
20201208T141304.335250Z |     INFO | network | fee_estimates {25: 21106, 10: 68310, 5: 68310, 2: 68310}
20201208T141304.450137Z |     INFO | network | fee_estimates {25: 21106, 10: 68310, 5: 68310, 2: 68310}
20201208T141305.609841Z |     INFO | network | fee_estimates {25: 21106, 10: 68310, 5: 68310, 2: 68310}

I also tried to load PSBT to sign from another wallet. If it includes that particular input, Electrum freezes. So it does not relate to fee calculation (PSBT should not calculate fees).


Title: Re: Cannot send TX - deadlock after pressing Pay
Post by: bob123 on December 08, 2020, 04:41:44 PM
To me, this indeed sounds like a bug.
You might get some trouble shooting tips on electrums github page (https://github.com/spesmilo/electrum/issues (https://github.com/spesmilo/electrum/issues)).

Feel free to create a new issue and hopefully it will get resolved in the next version. In the meantime you could use a different wallet to send your transaction including the small input. 


Title: Re: Cannot send TX - deadlock after pressing Pay
Post by: o_e_l_e_o on December 08, 2020, 11:33:47 PM
Is the wallet a standard Electrum wallet created from a seed phrase, or have the addresses/private keys been imported individually? Are all the inputs on the same address? Is it a standard address type? What happens if you try to spend the small input on its own?

Are you definitely using the BTC denomination and not mBTC? It could potentially be bugging out because you are trying to spend an input of only 30 satoshi.


Title: Re: Cannot send TX - deadlock after pressing Pay
Post by: pooya87 on December 09, 2020, 04:02:30 AM
Have you tried with an older version (anything below 4.0 but above 3.3.0)?
I don't think this has anything to do with fees, when you click Pay and see the "Preparing transaction..." and it goes away it means the update_tx method (the one that is blocking the UI) is already done and the next thing is being called which is the update() (https://github.com/spesmilo/electrum/blob/1684b348dfaf6aa25a3d100f0781993b66deae9c/electrum/gui/qt/transaction_dialog.py#L389) method which is probably where it hangs.

Do you have anything lightning network related in this wallet?


Title: Re: Cannot send TX - deadlock after pressing Pay
Post by: nc50lc on December 09, 2020, 06:11:44 AM
Try to use payto() command in the console to see if it can create a transaction.

The trick in order to set 1sat/vB fee without manual calculations is to fill the send tab with a dummy transaction using the "good inputs" to set the fee rate slider to 1sat/B (Static),
then cancel it. payto() will follow the fee rate you've set in that slider.

In the console, use: payto("destination_address","!"), eg.: payto("tb1qtcku.............3uwypts4","!")
Then broadcast the result using broadcast("signed_raw_transaction")
(both require the quotation marks; you may use an online decoder (eg: https://live.blockcypher.com/btc/decodetx/ (https://live.blockcypher.com/btc/decodetx/)) before broadcast-ing the raw tx)


Title: Re: Cannot send TX - deadlock after pressing Pay
Post by: BitMaxz on December 09, 2020, 11:10:18 PM
~snip~

Can you tell us what OS do you use with Electrum? and tell us if the wallet is generated from Electrum wallet?

If you have a backup seed of this wallet can you try to reinstall the Electrum on the same machine and import the backup seed and try to make a new transaction.

Or make a new transaction again but this time don't sign the transaction instead copy the raw/hex code of the unsigned transaction and paste it here let us analyze the transaction using https://coinb.in/#verify or any tools that can help to find the issue.


Title: Re: Cannot send TX - deadlock after pressing Pay
Post by: jooray on December 10, 2020, 06:32:31 PM
I am on macOs Big Sur, the wallet is Trezor hardware wallet, P2WKH in P2SH (3... segwit addr), no other keys were manually imported or anything non standard (except for increased gap limit).

I tried importing PSBT from Btcpayserver, that crashed the same way as creating the transaction itself.

The utxo was not 30 satoshi, I set the unit to BTC in settings.

I made the transaction with btcpayserver and their vault app in the end, worked almost flawlessly. Electrum saw the transaction and the wallet is in correct state again.


Title: Re: Cannot send TX - deadlock after pressing Pay
Post by: HCP on December 11, 2020, 10:03:17 PM
I am on macOs Big Sur, the wallet is Trezor hardware wallet, P2WKH in P2SH (3... segwit addr), no other keys were manually imported or anything non standard (except for increased gap limit).
Possibly some obscure Trezor/Electrum Plugin issue? ??? Next time try using the actual Trezor wallet (https://wallet.trezor.io/) to create/send a transaction as opposed to trying to create/send using Electrum...


I made the transaction with btcpayserver and their vault app in the end, worked almost flawlessly. Electrum saw the transaction and the wallet is in correct state again.
If it worked in another wallet, then it's possible my theory about it being Trezor/Plugin specific is correct... anyway, glad you managed to get it sorted. ;)


Title: Re: Cannot send TX - deadlock after pressing Pay
Post by: jooray on December 12, 2020, 12:20:45 AM
I can't use trezor wallet because it does not have configurable gap limit.

I don't think it being specific to Trezor plugin follows from what I said. I used a completely different wallet that signed and broadcasted with Trezor completely outside of electrum. And even PSBT signing with electrum did not work.


Title: Re: Cannot send TX - deadlock after pressing Pay
Post by: HCP on December 12, 2020, 11:10:11 AM
I don't think it being specific to Trezor plugin follows from what I said. I used a completely different wallet that signed and broadcasted with Trezor completely outside of electrum. And even PSBT signing with electrum did not work.
I meant the Electrum Trezor plugin... Hardware Wallet support in Electrum is achieved through the use of plugins, specific to each brand of device: https://github.com/spesmilo/electrum/tree/master/electrum/plugins

So, given it works "completely outside of electrum", it would indicate that it's not an issue with the device itself... and it's not an issue that seems to be within "core" Electrum either (haven't heard of similar issues with "normal" wallets etc)... so my guess would be something within the Electrum plugin for the Trezor.