4

Through dogecoin-cli, I sent half the dogecoins I own to an external address. Now, when I call the listaccounts function, I get this:

[root@web ~]# ./dogecoin-cli listaccounts
{
    "" : -25001.00000000,
    "doge" : 48136.85072100
}

Notice how the "" has -25001.00000000. I am using a query from php to get the balance of "doge" and display it to users. That returns 48136.85072100, which is a problem, because I only have 23135.85072100 doge. How can I fix this problem? Thanks!

  • This is a problem general to all Bitcoin-derivatives. Perhaps you should edit your question to make it more general. – Nick ODell Nov 18 '14 at 4:28
  • If you have multiple accounts: use sendfrom to send from a specific account. If you don't care about the accounts, use getbalance – TheDoctor Nov 18 '14 at 23:38
2

Problem

rricci2009 commented:

After few transaction by sendtoaddress command, balance in "" became negative. I solved with the "move" command from another account to "". [...]

Cause

sipa commented:

That is expected behavior, if your incoming transactions credit accounts other than "", but outgoing transactions debit account "" (the default if you're not using sendfrom), the "" account will go negative. [...]

Mitigation

Tectract commented:

[...] So, is there a way to do something like a sendtoaddress command that won't leave me with odd negative balances?

gavinandresen commented:

Use the sendfrom RPC command.

And you can use the move RPC command to reset account balances to what you expect (and listaccounts to see all accounts / balances)

Source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.