Bitcoin-cli getbalance returning negative value

0

I am running: bitcoin-cli getbalance username 1

It is returning -37.01

How is it possible for an account to be negative? Is this a bug or do I need to add stricter security when performing a send to prevent accounts from going negative?

I am running this in daemon mode on debian.

mocode10

Posted 2018-10-16T21:30:31.187

Reputation: 35

Answers

1

It is possible to an account balance to be negative.

Accounts do not correspond to on-chain transactions 1:1. They are a separate layer within Bitcoin Core. Non-obvious functionality like allowing accounts to go into negative is why they entire account system has been deprecated and will soon be removed.

You should either track separate accounts at an application layer, or use the new multiple wallet system in Bitcoin Core 0.17.0 to create a separate wallet for each account.

Raghav Sood

Posted 2018-10-16T21:30:31.187

Reputation: 10 897