Pages:
Author

Topic: Double-spend question - Legit coins vs duplicates (Read 3196 times)

full member
Activity: 154
Merit: 100
Added a pull request for "-purgetx" option.
Works for me.
Awesome. If someone wants to expedite a win32 binary, I'll pay for it (+ btc to m0Ray) Cheesy

Okay finally built this binary myself today using your code copied+pasted from github and recovered a good number of lost coins from no-man's land... Please send me a payment address m0Ray, it was your function that did the trick.
hero member
Activity: 588
Merit: 500
Added a pull request for "-purgetx" option.
Sorry I still don't know what a 'pull request' is although I've seen the term floating around this forum.

Is this -purgetx likely to end up in the official client any time soon or should I find it elsewhere? I'm in the process right now of learning a little more linux; just downloaded ubuntu livecd.

Pull request is a github-ism.  It is essentially a patch or fork off the code tree.

Specifically, the pull request is a request from one coder to the original coder to incorporate some new code.
kjj
legendary
Activity: 1302
Merit: 1026
Added a pull request for "-purgetx" option.
Sorry I still don't know what a 'pull request' is although I've seen the term floating around this forum.

Is this -purgetx likely to end up in the official client any time soon or should I find it elsewhere? I'm in the process right now of learning a little more linux; just downloaded ubuntu livecd.

Pull request is a github-ism.  It is essentially a patch or fork off the code tree.
full member
Activity: 154
Merit: 100
Added a pull request for "-purgetx" option.

Sorry I still don't know what a 'pull request' is although I've seen the term floating around this forum.

Is this -purgetx likely to end up in the official client any time soon or should I find it elsewhere? I'm in the process right now of learning a little more linux; just downloaded ubuntu livecd.
full member
Activity: 154
Merit: 100
Added a pull request for "-purgetx" option.
Works for me.

Awesome. If someone wants to expedite a win32 binary, I'll pay for it (+ btc to m0Ray) Cheesy
sr. member
Activity: 868
Merit: 251
Added a pull request for "-purgetx" option.
Works for me.
full member
Activity: 154
Merit: 100
You can just restore your wallet from a backup.

The problem extends there for me unfortunately as I backed up too soon after doing this, overwriting my oooold backup. Whoops. Will keep these 'empty' wallets for later as an unintended savings account, until the day I can extract the legit coins out of them.
administrator
Activity: 5222
Merit: 13032
You can just restore your wallet from a backup.
full member
Activity: 154
Merit: 100
The coins aren't in limbo. Such a transaction would not be accepted by the network so your 12 BTC is still usable in another valid transaction.
Yes, but the client instantly deducts the 20 as soon as it says "payment sent"... long before the network has a chance to see that it's invalid.
...
Maybe I do have a corrupt wallet.dat (or several).
Quite right.

The problem of "hung" transactions in wallet.dat becomes annoying. For myself I wrote a simple utility, but it needs compilation and so is not suitable for ordinary users.
Tomorrow I'll (maybe) try to implement "full rescan" patch to bitcoin. Going asleep today.

Your "full rescan" sounds like it could be exactly what's needed...

Will definitely pay you for it, although I'm lost when it comes to compiling C...
legendary
Activity: 1072
Merit: 1181
By the way, the "full rescan" I suggested/implemented does not remove transactions from the wallet, only adds/updates them, so it's not a solution for doood's problem.
sr. member
Activity: 868
Merit: 251
sr. member
Activity: 868
Merit: 251
If you're able to build from source and trust me, you can try https://github.com/sipa/bitcoin/tree/rejectedtx.
It will detect transactions that conflict with the block chain, and mark them inactive.
Yet another utility for the same problem. Wink

We definitely need a "full rescan" option.
legendary
Activity: 1072
Merit: 1181
Tomorrow I'll (maybe) try to implement "full rescan" patch to bitcoin. Going asleep today.

Sorry, did it myself already. https://github.com/bitcoin/bitcoin/pull/255
sr. member
Activity: 868
Merit: 251
The coins aren't in limbo. Such a transaction would not be accepted by the network so your 12 BTC is still usable in another valid transaction.
Yes, but the client instantly deducts the 20 as soon as it says "payment sent"... long before the network has a chance to see that it's invalid.
...
Maybe I do have a corrupt wallet.dat (or several).
Quite right.

The problem of "hung" transactions in wallet.dat becomes annoying. For myself I wrote a simple utility, but it needs compilation and so is not suitable for ordinary users.
Tomorrow I'll (maybe) try to implement "full rescan" patch to bitcoin. Going asleep today.
legendary
Activity: 1072
Merit: 1181
The coins aren't in limbo. Such a transaction would not be accepted by the network so your 12 BTC is still usable in another valid transaction.

Yes, but the client instantly deducts the 20 as soon as it says "payment sent"... long before the network has a chance to see that it's invalid.

So the client says 0.00 even though only 8 out of 20 was a double spend.

Maybe I do have a corrupt wallet.dat (or several). I'm not ruling that out.

If you're able to build from source and trust me, you can try https://github.com/sipa/bitcoin/tree/rejectedtx.

It will detect transactions that conflict with the block chain, and mark them inactive.

Make sure you have a backup of wallet.dat, though.
full member
Activity: 154
Merit: 100
try the -rescan parameter?

Thanks. Tried rescan. Tried upgrading client. Tried new block chain.

The above figures were examples only, but I'm basically out 12 btc at this point Sad

I think what I might do is just not touch them for a few days and see if it works itself out.

p.s. This is all home pc stuff... none of this affects the wallet on bitcointoss.com or flipforbits.com.
hero member
Activity: 721
Merit: 503
try the -rescan parameter?
full member
Activity: 154
Merit: 100
The coins aren't in limbo. Such a transaction would not be accepted by the network so your 12 BTC is still usable in another valid transaction.

Yes, but the client instantly deducts the 20 as soon as it says "payment sent"... long before the network has a chance to see that it's invalid.

So the client says 0.00 even though only 8 out of 20 was a double spend.

Maybe I do have a corrupt wallet.dat (or several). I'm not ruling that out.
full member
Activity: 154
Merit: 100
Well, the above scenario appears to have happened to me.

I'll try to gather real-life details shortly... m0Ray was helping out with it in another thread.

legendary
Activity: 1072
Merit: 1181
Please imagine the following scenario:

I have a new wallet on device A which I receive 2 transactions:

12 BTC
8 BTC

So my balance is 20 BTC.

I then copy that wallet.dat to an installation on device B.

From device B, I spend exactly 8 BTC, leaving a balance of 12 BTC
(I assume this spend should come directly from the address that received 8 BTC so 'change' will not be an issue).

Let's say this 8 BTC spend gets old and has many confirmations.

Now, I go back to device A, which still shows a total balance of 20 BTC.

It won't. It will see the spend on the network, and add a corresponding spending transaction to the wallet, bringing the balance to 12 BTC.

I then 'spend' the whole 20 BTC, dropping the balance to 0.00 in the client display.

This transaction should never be confirmed as 8 of it is a double spend, so my question is:

How to get the 12 legitimate coins back from this state of limbo and back into my balance?

If you do manage to spend the 20 BTC from B, without it having noticed the spend by A, you've indeed brought you wallet in a corrupted state, since it contains a transaction that conflicts with the block chain. It's possible to detect this conflict (I wrote a patch for that), but it's not yet merged in mainline bitcoin.
Pages:
Jump to: