Bitcoin Forum
May 06, 2024, 12:04:02 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Negative Balance in RPC Accounts  (Read 213 times)
ironfeast (OP)
Newbie
*
Offline Offline

Activity: 18
Merit: 0


View Profile
October 24, 2018, 06:52:37 AM
 #1

 Hi There,

I am using bitcoin core with RPC and have linked few accounts to it. When I run "listaccounts" command via bitcoin-cli, it gives following output:

{
  "": 0.00000000,
  "5ab4aafee94ff2258d2237a5": 0.01493139,
  "LABELPREFIX5ae21dd9bb5c583ec41732ae": 0.00000000,
  "LABELPREFIX5ae21de2bb5c583ec41732af": 0.00000000,
"LABELPREFIX5ae457e0bb5c583ec41732cd": -0.00588460,
  "LABELPREFIX5ae45999bb5c583ec41732d1": -0.00107414,

  "LABELPREFIX5ae6b2fcbb5c583ec41732e3": 0.00000000,
 "LABELPREFIX5ae86a453c74bc56539edbcd": -0.00144921,
  "LABELPREFIX5ae95e845e4db63ceb8b72e0": 0.00000000,
  "LABELPREFIX5aefffce0f96522e2658640a": 0.00000000,
  "LABELPREFIX5af000590f96522e2658640b": 0.00000000,
  "LABELPREFIX5af004350f96522e2658641b": 0.00000000,
  "LABELPREFIX5af004a70f96522e2658641f": 0.00000000,
  "LABELPREFIX5af0054e0f96522e26586422": 0.00000000,
  "LABELPREFIX5af008f00f96522e26586429": 0.00000000,
  "LABELPREFIX5af012010f96522e2658642e": 0.00000000,
  "LABELPREFIX5af013df0f96522e2658642f": 0.00000000,
  "LABELPREFIX5af025f60f96522e2658643c": 0.00000000,
  "LABELPREFIX5af0267d0f96522e2658643f": 0.00000000,
  "LABELPREFIX5af0295e0f96522e26586443": 0.00000000,
  "LABELPREFIX5af02a220f96522e26586447": 0.00000000,
  "LABELPREFIX5afd9be466270076e8aab970": 0.00000000,
  "LABELPREFIX5b05806e66270076e8aab9e8": 0.00000000,
  "LABELPREFIX5b05a9d666270076e8aaba18": 0.00000000,
  "LABELPREFIX5b0a43830153e23d9ee80064": 0.00000000,
  "LABELPREFIX5b0bcdd109b9224736c9b36f": 0.00000000,
 "LABELPREFIX5b17865709b9224736c9b3e5": -0.00652344,
  "LABELPREFIX5b1f714509b9224736c9b426": 0.00000000,
  "LABELPREFIX5b58638830db55306b567116": 0.00000000,
  "test": 0.00000000
}

I can't understand why these four accounts have negative balance. And when I add all these negative balances, outcome is this  "5ab4aafee94ff2258d2237a5": 0.01493139, balance.

Help in all ways is highly appreciated. God Bless You
1714997042
Hero Member
*
Offline Offline

Posts: 1714997042

View Profile Personal Message (Offline)

Ignore
1714997042
Reply with quote  #2

1714997042
Report to moderator
1714997042
Hero Member
*
Offline Offline

Posts: 1714997042

View Profile Personal Message (Offline)

Ignore
1714997042
Reply with quote  #2

1714997042
Report to moderator
1714997042
Hero Member
*
Offline Offline

Posts: 1714997042

View Profile Personal Message (Offline)

Ignore
1714997042
Reply with quote  #2

1714997042
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714997042
Hero Member
*
Offline Offline

Posts: 1714997042

View Profile Personal Message (Offline)

Ignore
1714997042
Reply with quote  #2

1714997042
Report to moderator
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
October 24, 2018, 07:02:44 AM
Merited by HeRetiK (1)
 #2

Using 'Accounts' inside of core is deprecated. Check https://bitcoin.org/en/developer-reference#rpc-quick-reference.

If you need to handle different type of user, you'll need to create an external database and link them to addresses generated by core.
The 'account functionality' inside of core does not work properly and is deprecated.

Do not use and/or rely on it.

achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
October 24, 2018, 01:35:08 PM
 #3

This is expected behavior with accounts. This is also one reason why you shouldn't use it.

seoincorporation
Legendary
*
Offline Offline

Activity: 3150
Merit: 2930


Top Crypto Casino


View Profile
October 25, 2018, 04:01:41 PM
 #4

You should try with :

Code:
bitcoin-cli getreceivedbyaddress 1BitcoinAddyFull...

And you can make a script with the list of addys to get the real balance from each one.
Code:
for a in $(cat addys.txt)
do
echo "$a-"$(bitcoin-cli getreceivedbyaddress $a)
done

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!