Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: xabbix on November 23, 2013, 07:04:31 PM



Title: Some questions regarding the JSON RPC API
Post by: xabbix on November 23, 2013, 07:04:31 PM
This is my bitcoin balance:

Code:
[root@server ~]# bitcoind getbalance
0.08360000

Here is a list of all accounts:
Code:
[root@server ~]# bitcoind listaccounts
{
    "" : -0.01640000,
    "Test" : 0.10000000
}

How is it possible that I a negative value on the default account?

Here is the list of addresses assigned to both default and Test account:

Code:
[root@server ~]# bitcoind getaddressesbyaccount Test
[
    "1GHt68zezGUWxYE3mt3YdBAuJ4Gg1XobEn",
    "1E3tD67MK4b7vAV4TUt7sS773Cyhzojoty"
]
[root@server ~]# bitcoind getaddressesbyaccount ''
[
    "1CepZwcr8enPR2MeXViu6jJmw1b5Duy7cr",
    "19Y9Zr5kFW8eFzq2wpbZwXEtdGX7TpkTpM",
    "1Nx3MF99VS84tzqGfekVuQEYxYRWm9NxSZ"
]

As you saw before I have some balance but checking these five addresses none of them has any balance according to blockchain.info

Now it get's weirder, let's list all addresses:

Code:
[root@server ~]# bitcoind listaddressgroupings
[
    [
        [
            "1D8VXBrwLdkM7q97V9DrhCz6i9qSG7dH8X",
            0.00000000
        ],
        [
            "1Da5QLYwBUamhPhLHvVUfS8qyHmkWDLowV",
            0.00000000
        ],
        [
            "1GHt68zezGUWxYE3mt3YdBAuJ4Gg1XobEn",
            0.00000000,
            "Test"
        ],
        [
            "1GYfFugAg2JqmbNBUPU6mKjG5rBg2hG9Rn",
            0.00000000
        ],
        [
            "1JSmKBxUWTJpAitTJ6zHZ3u1YvnS9wmen2",
            0.00000000
        ],
        [
            "12QWneBpiY7QcfYsKya82qvoJ54zxDJBLn",
            0.00000000
        ],
        [
            "12eH7sqhMrkfPafpL2ReewrtgehmxvJ894",
            0.00000000
        ],
        [
            "17fuA8bpyDZy2s9duVmB89EUigZbfSa1n9",
            0.00000000
        ],
        [
            "1HzRmT7GyJWFTqiGz48KhKvFZGnB4dFKCH",
            0.00000000
        ],
        [
            "1DByVqUx95R3qiriq3vQfT1b8dmn8eomT2",
            0.00000000
        ],
        [
            "1EZLyKZd79qtpPk7g5GW6ZLRSeKCuNkSSJ",
            0.00000000
        ],
        [
            "1FSrVyFDZTJGBb4EdF2YTspsfEDySGCLrc",
            0.00000000
        ],
        [
            "1Q7yQ1XpZcxaAF3myohHJraxzD5DuANjmz",
            0.00000000
        ],
        [
            "12kpNxrWr15aRvqWEpBtYJZUKEqvrqFQvg",
            0.08360000
        ],
        [
            "1DyNaapimQowSpMJYucaw4DFrNyKGEXRJo",
            0.00000000
        ]
    ]
]

How come I get so many addresses? When I listed all available accounts and their addresses there were 5 listed.
And also, none of the above addresses has any balance in them..


Title: Re: Some questions regarding the JSON RPC API
Post by: kjj on November 24, 2013, 12:43:15 PM
How is it possible that I a negative value on the default account?

Accounts don't work like you think they should.  Lots of threads on this.

How come I get so many addresses?

Change.


Title: Re: Some questions regarding the JSON RPC API
Post by: xabbix on November 24, 2013, 03:06:51 PM
Is there a JSON RPC command I can run to show me either all addresses or only addresses with positive balance in them?

Thanks


Title: Re: Some questions regarding the JSON RPC API
Post by: kjj on November 25, 2013, 04:03:17 AM
You could run listunspent and work backwards from the scriptPubKey.

But why?