Bitcoin Forum
April 18, 2024, 04:02:21 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Removing a transaction from Electrum  (Read 289 times)
ranochigo (OP)
Legendary
*
Offline Offline

Activity: 2954
Merit: 4158


View Profile
July 19, 2020, 04: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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
"The nature of Bitcoin is such that once version 0.1 was released, the core design was set in stone for the rest of its lifetime." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713412941
Hero Member
*
Offline Offline

Posts: 1713412941

View Profile Personal Message (Offline)

Ignore
1713412941
Reply with quote  #2

1713412941
Report to moderator
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
July 19, 2020, 04: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.
nc50lc
Legendary
*
Offline Offline

Activity: 2380
Merit: 5477


Self-proclaimed Genius


View Profile
July 19, 2020, 05: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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
ranochigo (OP)
Legendary
*
Offline Offline

Activity: 2954
Merit: 4158


View Profile
July 19, 2020, 06: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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10489



View Profile
July 19, 2020, 07:46:10 AM
Merited by ranochigo (2)
 #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

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Husires
Legendary
*
Offline Offline

Activity: 1582
Merit: 1284



View Profile WWW
July 19, 2020, 02:39:47 PM
Last edit: July 28, 2020, 06:46:34 PM by Husires
 #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

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
COOLak
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
September 21, 2020, 05: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.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
September 22, 2020, 12:47:36 AM
Last edit: November 15, 2023, 12:55:20 AM by HCP
 #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.


█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10489



View Profile
September 22, 2020, 05: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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
vindard
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
March 28, 2024, 03:04:43 AM
 #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="<txid-here>"
wallet.db.remove_txi(txid)
nc50lc
Legendary
*
Offline Offline

Activity: 2380
Merit: 5477


Self-proclaimed Genius


View Profile
March 28, 2024, 04: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="<txid-here>"
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")

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!