Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: binaryFate on June 23, 2013, 01:28:51 PM



Title: Discard invalid transaction lying around forever
Post by: binaryFate on June 23, 2013, 01:28:51 PM
After what was I think a double-spend accident, I have an invalid transaction that my bitcoind keeps around forever, and I would like to "discard" it.
I'm not satisfied with some answers that I've seen here and there:

  • I don't want to rely on wallet backups if possible.
  • Pywallet seems to be able to do that, but I'm working on a (linux) machine without graphical mode and need command line tools only.
  • I tried the method here: http://bitcoin.stackexchange.com/questions/3654/what-is-the-best-way-to-recover-from-an-accidental-double-spend
    But it seems the RPC method "removeprivkey" is not available anymore in recent versions of bitcoind

I'd like to find a clean way to do this, as it might happen again in the future while I'm experimenting with some code...

All this is on the testnet but I guess possible methods are common to main net too.


Title: Re: Discard invalid transaction lying around forever
Post by: jackjack on June 23, 2013, 01:33:15 PM
Pywallet seems to be able to do that, but I'm working on a (linux) machine without graphical mode and need command line tools only.
Did you try using Lynx? http://en.wikipedia.org/wiki/Lynx_%28web_browser%29
If it doesn't work or if you can't for whatever reason I can make this possible with the CLI


Title: Re: Discard invalid transaction lying around forever
Post by: binaryFate on June 23, 2013, 01:40:27 PM
I'm not entirely sure to get what you suggest here.
Are you saying to use lynx in combination with the "--web" option of pywallet?


Title: Re: Discard invalid transaction lying around forever
Post by: jackjack on June 23, 2013, 01:40:50 PM
Absolutely


Title: Re: Discard invalid transaction lying around forever
Post by: binaryFate on June 23, 2013, 02:21:33 PM
Ok, I see the the pywallet page properly with lynx. However I don't manage to delete anything, nor to trigger any action in fact.

When I try on a machine with graphical mode, through firefox, deletion of a transaction gives some info in the area "DATA" on the right.
I see nothing like that through lynx, "clicking" the button for deletion just sends me back at the top of the page but nothing else seems to happen.

My experience with lynx is very limited, so maybe I'm missing something obvious  ???


Title: Re: Discard invalid transaction lying around forever
Post by: jackjack on June 23, 2013, 02:31:21 PM
Ok, I see the the pywallet page properly with lynx. However I don't manage to delete anything, nor to trigger any action in fact.

When I try on a machine with graphical mode, through firefox, deletion of a transaction gives some info in the area "DATA" on the right.
I see nothing like that through lynx, "clicking" the button for deletion just sends me back at the top of the page but nothing else seems to happen.

My experience with lynx is very limited, so maybe I'm missing something obvious  ???

I never tried using Lynx with pywallet so I don't know what behavior you're supposed to see. I'm not even sure whether it supports Javascript or not.
Did you check if it worked?
If not, I'll make a CLI command in around 3-4 hours (if I forget drop me a PM)


Title: Re: Discard invalid transaction lying around forever
Post by: binaryFate on June 23, 2013, 02:45:45 PM
No, lynx doesn't support javascript. So at least, that's the reason.
That would be great if there would be something that can be directly run from command line (the same way as --dumpwallet), just taking the TxId as input (or "all"?).
I don't know how specific is my need here, I might take the time to implement this myself if you have other more important things to work on.

More generally, do you plan on opening all existing functionnalities to command line with some flags? I think it would be a cool feature.


Title: Re: Discard invalid transaction lying around forever
Post by: jackjack on June 23, 2013, 02:57:43 PM
No, lynx doesn't support javascript. So at least, that's the reason.
That would be great if there would be something that can be directly run from command line (the same way as --dumpwallet), just taking the TxId as input (or "all"?).
I don't know how specific is my need here, I might take the time to implement this myself if you have other more important things to work on.

More generally, do you plan on opening all existing functionnalities to command line with some flags? I think it would be a cool feature.
I'm not that busy currently it's just that I don't have access to my dev PC right now. If you want to make this on your own temporarily, take a look at delete_from_wallet

Yes I have such a project. Actually the aim is to rebuild pywallet from scratch with a structure that will easily allow me to create interfaces that will have the same commands: the CLI, the WUI, and GUIs (at least Qt for now)
I'm on another long project for now so I didn't even start it, I modify the current version with users' needs instead


Title: Re: Discard invalid transaction lying around forever
Post by: jackjack on June 23, 2013, 11:02:53 PM
Couldn't make internet working, except on my mobile...
I'll try again tomorrow. Once I have internet it's a matter of seconds.


Title: Re: Discard invalid transaction lying around forever
Post by: binaryFate on June 23, 2013, 11:31:35 PM
Don't worry, no hurry on my side. I have very little time in the few coming days so I won't be able to dive into pywallet code now.
Anyway, thanks for being super responsive!  :)


Title: Re: Discard invalid transaction lying around forever
Post by: jackjack on June 25, 2013, 08:45:08 PM
That's insane, I already did this feature and I don't remember it...
https://bitcointalk.org/index.php?topic=34028.msg2239679#msg2239679

By the way, that made me find a bug when you don't use the '--web' flag so you may want to update anyway


Title: Re: Discard invalid transaction lying around forever
Post by: binaryFate on June 25, 2013, 10:08:04 PM
Awesome! I'll try this! Thanks  :)