Author

Topic: Removing a transaction from Electrum (Read 292 times)

legendary
Activity: 2394
Merit: 5531
Self-proclaimed Genius
March 28, 2024, 12:12:35 AM
#11
This is the thing that ended up working for me. You have to disconnect from the electrum server, run the command below, and then close and reopen the wallet. This worked for me on v4.5.4
Code:
txid=""
wallet.db.remove_txi(txid)
Is this in console or command line?
Because in the GUI's console (v4.5.4); I tested it and the transaction remains, plus it causes a bug if the outbound transaction has change.
Instead of removing the transaction, it shows that the change is added to the balance instead (shows as "+change_amount" in black text).
If the transaction doesn't have a change, it'll be removed.

Instead, this command will remove it entirely:
Code:
wallet.adb.remove_transaction("txid-here")
newbie
Activity: 0
Merit: 0
March 27, 2024, 11:04:43 PM
#10
Wish there's an advanced mode in Electrum which would give the user more liberty to mess around with the wallet.

you may want to ask @Abdussamad since he is more familiar with this types of commands but you should be able to use the following command in your console tab to remove a transaction from your wallet file without needing to manually opening it and messing the JSON up:
Code:
wallet.remove_transaction(txid)

if you understand python more than me this is the source code: https://github.com/spesmilo/electrum/blob/52f8aafb604d05487a0612f65bacb966c0d0f569/electrum/wallet_db.py#L924
this is a test vector: https://github.com/spesmilo/electrum/blob/52f8aafb604d05487a0612f65bacb966c0d0f569/electrum/tests/test_wallet_vertical.py#L2359-L2406

This is the thing that ended up working for me. You have to disconnect from the electrum server, run the command below, and then close and reopen the wallet. This worked for me on v4.5.4

Code:
txid=""
wallet.db.remove_txi(txid)
legendary
Activity: 3430
Merit: 10504
September 22, 2020, 01:07:10 AM
#9
When I open my Electrum wallet in a text editor, there's no JSON, there's just a mess of unformatted characters, and no transactions can be found even via search. Apparently it's encrypted.

you should always try to avoid manually modifying your wallet files for any wallet, there is always a very good change that you mess things up. if you had no other choice, then you still have to try and find a way to do it through the wallet interface itself. in this case use the Console tab as i mentioned above.

it goes without saying that you should keep a backup of your seed phrase so that you can recover your wallet/funds.
HCP
legendary
Activity: 2086
Merit: 4314
September 21, 2020, 08:47:36 PM
#8
When I open my Electrum wallet in a text editor, there's no JSON, there's just a mess of unformatted characters, and no transactions can be found even via search. Apparently it's encrypted.
Yes, if you selected the "Encrypt Wallet File" option when creating the wallet, then your wallet file will show as "a mess of unformatted characters":



If your wallet files is currently encrypted, but you're wanting to view it in the text editor, you would need to select the menu options "Wallet -> Password". You'll see a note telling you, that your wallet is both password protected and encrypted.

You can simply re-enter your password into all 3 boxes and then untick the "Encrypt wallet file" option:



You should then be able to open the wallet file in a text editor and see the JSON layout. Note that with "password protection", all the "important" stuff (like seeds, private keys etc) will still be stored as encrypted text within the JSON. If you want to see the plaintext for seeds/private keys, you need to set a blank password as well.

newbie
Activity: 2
Merit: 0
September 21, 2020, 01:53:22 PM
#7
When I open my Electrum wallet in a text editor, there's no JSON, there's just a mess of unformatted characters, and no transactions can be found even via search. Apparently it's encrypted.
legendary
Activity: 1582
Merit: 1284
July 19, 2020, 10:39:47 AM
#6
Is there any way for me to remove an entire unconfirmed transaction from Electrum?
AFAIK, yes you can do it with https://steemit.com/bitcoin/@profitgenerator/tutorial-how-to-fix-unconfirmed-transactions
In short, it is Double-Spending, Disconnect the Internet, Copy the hash of the transaction, Create a Backup of the wallet, edit the wallet file with a text editor,  remove some parts carefully to keep the JSON syntax intact, open the wallet (offline), Re-create the transaction, but this time put a higher fee and continue to broadcast the new transaction with higher fees.

source https://steemit.com/bitcoin/@profitgenerator/tutorial-how-to-fix-unconfirmed-transactions

The old transaction will be canceled and the new transaction broadcasted.
you should be fast.

In theory, it was a successful idea, but I did not try it.


Quote
Press CTRL-F on the keyboard, and search for this hash in the file. It should appear 4 times, in different places, you need to delete them, but carefully to keep the JSON syntax intact, so I have highlighted what you need to delete, it should be different for you, but you will get the idea, it should be everything that is highlighted:
Here the section between the [] brackets needs to be deleted + the coma above.
This is the transaction data section, the TX hash and right below the data should be deleted, as highlighted above.
Delete everything between the {} brackets in the highlighted stuff + the comma after the brackets.
Delete everything between the {} brackets in the highlighted stuff + the comma after the brackets.

source https://steemit.com/bitcoin/@profitgenerator/tutorial-how-to-fix-unconfirmed-transactions

 If it doesn't load, you need to restore your backup because you delete something wrong and you need to do it again
legendary
Activity: 3430
Merit: 10504
July 19, 2020, 03:46:10 AM
#5
Wish there's an advanced mode in Electrum which would give the user more liberty to mess around with the wallet.

you may want to ask @Abdussamad since he is more familiar with this types of commands but you should be able to use the following command in your console tab to remove a transaction from your wallet file without needing to manually opening it and messing the JSON up:
Code:
wallet.remove_transaction(txid)

if you understand python more than me this is the source code: https://github.com/spesmilo/electrum/blob/52f8aafb604d05487a0612f65bacb966c0d0f569/electrum/wallet_db.py#L924
this is a test vector: https://github.com/spesmilo/electrum/blob/52f8aafb604d05487a0612f65bacb966c0d0f569/electrum/tests/test_wallet_vertical.py#L2359-L2406
legendary
Activity: 2954
Merit: 4158
July 19, 2020, 02:47:44 AM
#4
You can use the "Export->for CoinJoin" and "combine" feature.

First, you need to enable "Advanced Preview" in the settings so it will open even when using RBF.
Create a new transaction spending the "other UTXO", send to your desired output (same address or others).
Show the advance preview, set the fee and finalize, click export->for conjoin (copy), do not sign and close the window.

Then hit "increase fee" to the previously unconfirmed tx and set a higher fee, after clicking "pay", advanced preview should open.
Click "combine->join inputs/outputs" and paste the other partial transaction and click load.
Next, click sign (double-check the outputs!) and broadcast it.

The problem is: it will produce two outputs of the same address instead of one since it's basically two transactions merged as one.
Hmm interesting.. Will try it when I have the time.


I made a backup of my wallet file and started to modify it. I removed all the relevant TXID and turned my internet connection off. I loaded up my Electrum and it appeared back as an unspent output. So I crafted a transaction in the GUI, exported it and broadcasted it. Worked well but I had to take care to not mess the JSON formatting up or an error will appear when I initialize the wallet. Has to be done offline too or the wallet would load the unconfirmed transaction again.

Wish there's an advanced mode in Electrum which would give the user more liberty to mess around with the wallet.
legendary
Activity: 2394
Merit: 5531
Self-proclaimed Genius
July 19, 2020, 01:50:45 AM
#3
You can use the "Export->for CoinJoin" and "combine" feature.

First, you need to enable "Advanced Preview" in the settings so it will open even when using RBF.
Create a new transaction spending the "other UTXO", send to your desired output (same address or others).
Show the advance preview, set the fee and finalize, click export->for conjoin (copy), do not sign and close the window.

Then hit "increase fee" to the previously unconfirmed tx and set a higher fee, after clicking "pay", advanced preview should open.
Click "combine->join inputs/outputs" and paste the other partial transaction and click load.
Next, click sign (double-check the outputs!) and broadcast it.

The problem is: it will produce two outputs of the same address instead of one since it's basically two transactions merged as one.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
July 19, 2020, 12:58:33 AM
#2
No there's nothing, I normally use another device with the last history on to sign a new transaction - or at least there was nothing before v4 i haven't checked fully with v4s capabilities.

The only thing I found is if it takes longer than 24 for a transaction to be confirmed it normally gets an X next to it and those inputs become spendable again.
legendary
Activity: 2954
Merit: 4158
July 19, 2020, 12:54:03 AM
#1
Is there any way for me to remove an entire unconfirmed transaction from Electrum?

I'm trying to do a RBF but adding another UTXO at the same time. AFAIK, Electrum doesn't specifically allow inclusion of additional inputs in the replacement transaction. Of course, I can just craft my own raw TX but I'm wondering if there's any method to do it from the GUI.
Jump to: