Author

Topic: satoshi-client: why are the balances in "listaccounts" bogus? (Read 1084 times)

newbie
Activity: 12
Merit: 0
[
Code:
createrawtransaction '{["txid":"9a8b7c6d5e4f","vout":1}]' '{"1abc":42}'
Error: Error parsing JSON:{["txid":"9a8b7c6d5e4f","vout":1}]
What am I missing?

You started with curly-brace then square-brace.  Try [{...}]
full member
Activity: 216
Merit: 100
That wiki page needs updating, the new 'raw transactions' api lets you create transactions from specific previous transactions.
See:  https://en.bitcoin.it/wiki/Raw_Transactions

It seems I'm too dumb to use this API.

Usage is:
  createrawtransaction [{"txid":txid,"vout":n},...] {address:amount,...}

Assuming "9a8b7c6d5e4f" and 1 were the "txid" and "vout" of a previous
output and "1abc" some target address, I tried (within the debug-console):

Code:
createrawtransaction [{"txid":"9a8b7c6d5e4f","vout":1}] {"1abc":42}
Error: Error parsing JSON:[{txid:9a8b7c6d5e4f,vout:1}]

and

Code:
createrawtransaction '{["txid":"9a8b7c6d5e4f","vout":1}]' '{"1abc":42}'
Error: Error parsing JSON:{["txid":"9a8b7c6d5e4f","vout":1}]

What am I missing?
newbie
Activity: 12
Merit: 0
That wiki page needs updating, the new 'raw transactions' api lets you create transactions from specific previous transactions.

See:  https://en.bitcoin.it/wiki/Raw_Transactions
full member
Activity: 216
Merit: 100
Received outputs are associated to the respective address's account,
but spends (at least, those not generated by the satoshi-client itself) get booked
on the "" account. And "move" may be used to update the inter-account balances.

You can use the 'sendfrom' RPC command to send from an account other than ""
This wiki page explains it:  https://en.bitcoin.it/wiki/Accounts_explained


I've read a couple of pages of that wiki already (mostly lowlevel stuff, like scripts, ...),
but have so far missed this one. Thanks for pointing to it.

Quote
from the mentioned wiki:
 There is no way to ask Bitcoin to "create a payment transaction using the coins received
 from these previously received transactions."

I find this a pity.  blockchain at least lets me pick which address's transactions to make
the new payment from, but the satoshi-client doesn't seem to even allow that.
newbie
Activity: 12
Merit: 0
Received outputs are associated to the respective address's account,
but spends (at least, those not generated by the satoshi-client itself) get booked
on the "" account. And "move" may be used to update the inter-account balances.

You can use the 'sendfrom' RPC command to send from an account other than ""
This wiki page explains it:  https://en.bitcoin.it/wiki/Accounts_explained
b!z
legendary
Activity: 1582
Merit: 1010
You created labels (accounts) for some addresses, and then you received bitcoins with them.  Then you spent them without specifying a label (account) that they should come out of, meaning they were deducted from the "" account.

Accounts are just an internal bookkeeping system.  The actual transactions in your wallet don't carry the tags with them.

Now that's new to me.  I thought, by assigning some address to an account,
I'd essentially tell the satoshi-client to consider any tx-endpoint (input or output)
involving that address (no matter how or where it was generated) as belonging
to that account. Kind of like partitioning the wallet.  (I didn't really understand
how "move" worked in that model, but when one is new to a concept then
perceived inconsistencies are not immediately minded, but sometimes kept until
it becomes clear how to really resolve them.)

As it seems to me now, each transaction's money itself is associated with an
account. Received outputs are associated to the respective address's account,
but spends (at least, those not generated by the satoshi-client itself) get booked
on the "" account. And "move" may be used to update the inter-account balances.

Getting money to one account and paying from another (already negative
balanced) account now seems oh so "real-world-money"-ish to me ;-)


Yes, you can consider Bitcoin real world money. Smiley
full member
Activity: 216
Merit: 100
You created labels (accounts) for some addresses, and then you received bitcoins with them.  Then you spent them without specifying a label (account) that they should come out of, meaning they were deducted from the "" account.

Accounts are just an internal bookkeeping system.  The actual transactions in your wallet don't carry the tags with them.

Now that's new to me.  I thought, by assigning some address to an account,
I'd essentially tell the satoshi-client to consider any tx-endpoint (input or output)
involving that address (no matter how or where it was generated) as belonging
to that account. Kind of like partitioning the wallet.  (I didn't really understand
how "move" worked in that model, but when one is new to a concept then
perceived inconsistencies are not immediately minded, but sometimes kept until
it becomes clear how to really resolve them.)

As it seems to me now, each transaction's money itself is associated with an
account. Received outputs are associated to the respective address's account,
but spends (at least, those not generated by the satoshi-client itself) get booked
on the "" account. And "move" may be used to update the inter-account balances.

Getting money to one account and paying from another (already negative
balanced) account now seems oh so "real-world-money"-ish to me ;-)
kjj
legendary
Activity: 1302
Merit: 1026
You created labels (accounts) for some addresses, and then you received bitcoins with them.  Then you spent them without specifying a label (account) that they should come out of, meaning they were deducted from the "" account.

Accounts are just an internal bookkeeping system.  The actual transactions in your wallet don't carry the tags with them.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
Yes, the total sum is correct.

That's good to know.

I don't think I used "move" specifically. I haven't actually initiated any transaction
from my local client, yet. (I use blockchain.info wallet for that) I've only imported
a few of my blockchain-wallet privkeys into local satoshi-client - mainly for reasons
of a second viewpoint on the relevant transactions.

My surprise is really about how these numbers are arrived at.
How can it see more "activity" on an address than ever existed for it?
(I guess, the negative balance for "" then is just the difference to the
actual balance)

I am pretty sure (but not 100% certain as I haven't played with it yet) that the Satoshi client will enable you to create negative balances via the "move" command. No actual tx is created when doing such an operation (it's wallet only data) and is allowed so that someone using bitcoin as a service could say issue a fee to an account before it has been paid.

If you didn't issue any "move" commands though then perhaps it is something more to do with the private key that was imported (perhaps check the blockchain info for the public key to see if the address was involved any tx's in the past).
full member
Activity: 216
Merit: 100
If you add up those numbers you end up with 0.05887045 (so well under the 0.1 amount you mentioned) but how those numbers got there in the first place seems a little strange.

Did you use the "move" RPC command at all?

Yes, the total sum is correct.
I don't think I used "move" specifically. I haven't actually initiated any transaction
from my local client, yet. (I use blockchain.info wallet for that) I've only imported
a few of my blockchain-wallet privkeys into local satoshi-client - mainly for reasons
of a second viewpoint on the relevant transactions.

My surprise is really about how these numbers are arrived at.
How can it see more "activity" on an address than ever existed for it?
(I guess, the negative balance for "" then is just the difference to the
actual balance)
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
If you add up those numbers you end up with 0.05887045 (so well under the 0.1 amount you mentioned) but how those numbers got there in the first place seems a little strange.

Did you use the "move" RPC command at all?
full member
Activity: 216
Merit: 100
When I enter command "listaccounts" in the debug-console, I see this:

{
"" : -1.48690711,
"foo" : 0.26174872,
"bar" : 1.28402884,
... (plus some accounts of miniscule but correct balances)
}

I've only recently started with bitcoins, collecting from free-bitcoin-sites
and never so far owned more than 0.1 bitcoins.

Where does it get these numbers from, and why is the empty account's
balance negative?  All the addresses in my wallet are assigned to
accounts.
Jump to: