Author

Topic: [PULL] spent per txout (Read 1818 times)

hero member
Activity: 540
Merit: 500
April 08, 2011, 03:55:11 AM
#7
Good job ! I'm waiting for this to be in the official client.

This will allow everybody (with another patch, to add possibility to select the from address) to send a transaction with the same address from and to, to prove the ownership of public addresses (needed here for example) by sending specified amount at specified time (more decimal precision than current 2 digits would be better... But this will be for later :p).
legendary
Activity: 1652
Merit: 2317
Chief Scientist
April 06, 2011, 08:43:38 AM
#6
I added a comment to the PULL request-- I ran into an issue when sanity testing this (a testnet wallet that reports an impossibly high balance after conversion).
legendary
Activity: 1072
Merit: 1189
April 03, 2011, 03:52:36 PM
#5
Trying to review the diff - looks like UpdateSpent() could return fReturn uninitialized if it's false.

You were right - fixed.
Hal
vip
Activity: 314
Merit: 4276
April 03, 2011, 03:31:00 PM
#4
Trying to review the diff - looks like UpdateSpent() could return fReturn uninitialized if it's false.
Hal
vip
Activity: 314
Merit: 4276
April 03, 2011, 02:07:44 PM
#3
This is good because without it, someone can test whether 2 addresses are in the same wallet, by sending a payment to both of them. Then you can't spend one without the other.
legendary
Activity: 1596
Merit: 1100
April 02, 2011, 05:13:08 PM
#2

It is likely this will go into 0.3.21.

legendary
Activity: 1072
Merit: 1189
April 02, 2011, 04:53:10 PM
#1
Hello,

this pull request has been waiting for some time, so maybe i should start a forum thread about it:
https://github.com/bitcoin/bitcoin/pull/123

The problem

Bitcoin currently only works for many things "per transaction", transactions as a whole are spent or not, and as a whole give a certain amount of available credits. However, when multiple outputs of a single transaction are available, it is sometimes useful to not use all of them. See https://bitcointalksearch.org/topic/why-was-this-transaction-structured-this-way-3759

The problem with this is that bitcoin's wallet database only keeps a single boolean per transaction to indicate "spentness".

The patch

This patch adds an (optional) array of booleans per tx to the wallet format, while keeping the old single boolean updated according to "at least one output spent". Calculation of available coins is updated to only count the specifically available ones, and selection of coins for new transactions is done per-txout instead of per-tx (fixing the linked issue).

Backward compatibility

When you load an updated wallet (with partially-spent transactions) into an old client, it will show you a lower balance than the actual one, since it cannot cope with the available partial outputs. The transaction list is accurate though, and switching back to the new client fixes the issue.
Jump to: