Bitcoin Forum
May 02, 2024, 11:59:30 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Difference in getbalance and total sum of listunspent  (Read 76 times)
chiefpriest (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 1


View Profile
March 19, 2023, 12:42:01 AM
Merited by ABCbits (1)
 #1


Bitcoin Core Version: bitcoin-core-24.-
Wallet version : 169900
Operating System: Ubuntu 22.04 64-bit
System Hardware Specs: N/A
Description of Problem: is there a reason why the total sum of listunspent and getbalances are not the same
Any Related Addresses: N/A
Any Related Transaction IDs: N/A
Screenshot of the problem: N/A
Log Files from the Bitcoin Client: N/A




bitcoin-cli listunspent | grep amount
    "amount": 0.00002129,
    "amount": 0.00002129,
    "amount": 0.00004280,
    "amount": 0.00002756,
    "amount": 0.00004278,
    "amount": 0.00004263,
    "amount": 0.00004263,


bitcoin-cli getbalances
{
  "mine": {
    "trusted": 0.00002756,
    "untrusted_pending": 0.00000000,
    "immature": 0.00000000,
    "used": 0.00021342
  }
}
1714651171
Hero Member
*
Offline Offline

Posts: 1714651171

View Profile Personal Message (Offline)

Ignore
1714651171
Reply with quote  #2

1714651171
Report to moderator
1714651171
Hero Member
*
Offline Offline

Posts: 1714651171

View Profile Personal Message (Offline)

Ignore
1714651171
Reply with quote  #2

1714651171
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, but full nodes are more resource-heavy, and they must do a lengthy initial syncing process. As a result, lightweight clients with somewhat less security are commonly used.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714651171
Hero Member
*
Offline Offline

Posts: 1714651171

View Profile Personal Message (Offline)

Ignore
1714651171
Reply with quote  #2

1714651171
Report to moderator
1714651171
Hero Member
*
Offline Offline

Posts: 1714651171

View Profile Personal Message (Offline)

Ignore
1714651171
Reply with quote  #2

1714651171
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6577


Just writing some code


View Profile WWW
March 19, 2023, 12:58:41 AM
Merited by LoyceV (4), EFS (2)
 #2

I don't see where they are not the same. All of the amounts sum to the same value. Your wallet appears to have enabled the avoid_reuse flag, so the values in UTXOs for scripts that have already been used before will be counted in the "used" balance separately from "trusted".

nc50lc
Legendary
*
Online Online

Activity: 2408
Merit: 5580


Self-proclaimed Genius


View Profile
March 19, 2023, 07:22:38 AM
Merited by LoyceV (4)
 #3

-snip-    "used": 0.00021342
"used" doesn't mean that those are spent, it only means (in layman terms) that you've received bitcoins through an addresses, spent it and then received coins through that address again.
In case you unintentionally enabled the flag, you can disable it with:
Code:
bitcoin-cli setwalletflag "avoid_reuse" false


On a side note, accumulating more UTXOs with small amounts like those could end up causing you to pay high txn fee if you need to spend hundreds of them in one transaction.
If those are mining pool payments, I'd consider setting a higher minimum payment amount.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
chiefpriest (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 1


View Profile
March 19, 2023, 07:55:15 AM
 #4

I don't see where they are not the same. All of the amounts sum to the same value. Your wallet appears to have enabled the avoid_reuse flag, so the values in UTXOs for scripts that have already been used before will be counted in the "used" balance separately from "trusted".


Is there any real potential benefits for settings avoid_reuse as False. And thanks for the explanation. I did some calculations and yeah, it matches.
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!