Bitcoin Forum
October 03, 2024, 09:44:45 PM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Solved] Different values running `listtransactions` and `getbalance`  (Read 156 times)
dbt (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
June 28, 2018, 04:30:20 AM
Last edit: June 28, 2018, 10:39:43 AM by dbt
 #1

Hi all,

Running `listtransactions "*" 99999` and adding up all the `amount` and `fee`(fee only for send category) fields
I have a different value that running `getbalance "*"` in my testnet and mainnet nodes.

I don't have pending confirmation transactions.

Has anyone ever experienced this?
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
June 28, 2018, 04:58:40 AM
Last edit: November 15, 2023, 07:54:54 AM by HCP
 #2

Do you have any "incomplete" (for instance conflicted or abandoned) transactions in your transaction list? These look like "greyed out" transactions with an "X" next to it and the amount in []'s like this:


If so, that is likely to be your problem... those transactions still display in the listtransactions output but are not included when running getbalance


You can probably filter it out by knowing this:
Quote
"confirmations": n,       (numeric) The number of confirmations for the transaction. Available for 'send' and
                                         'receive' category of transactions. Negative confirmations indicate the
                                         transaction conflicts with the block chain


So, any of the transactions output by listtransactions that has a negative value for "confirmations" should be ignored and the "amount" and/or "fee" record should not be included in your totals.

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


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
dbt (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
June 28, 2018, 05:31:35 AM
 #3

Do you have any "incomplete" (for instance conflicted or abandoned) transactions in your transaction list? These look like "greyed out" transactions with an "X" next to it and the amount in []'s like this:
https://i.imgur.com/1QssvAe.png

If so, that is likely to be your problem... those transactions still display in the listtransactions output but are not included when running getbalance


You can probably filter it out by knowing this:
Quote
"confirmations": n,       (numeric) The number of confirmations for the transaction. Available for 'send' and
                                         'receive' category of transactions. Negative confirmations indicate the
                                         transaction conflicts with the block chain


So, any of the transactions output by listtransactions that has a negative value for "confirmations" should be ignored and the "amount" and/or "fee" record should not be included in your totals.

Thanks for the response,

In my list of transactions, for all them:

walletconflicts = []
abandoned = false (for the biggest part of them I don't have this field)
confirmations > 0

I don't have access to a GUI client to use that, but I believe that these fields must means the same thing.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
June 28, 2018, 05:36:44 AM
 #4

It also appears that any "Pay To Many" transactions you may have sent, will also show up as separate records in listtransactions... so the "fee" will be shown twice and could throw off your calculations if you're not careful.

I just spent 5 minutes trying to figure out why my total was off by around 7000 sats Wink

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


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
dbt (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
June 28, 2018, 10:40:57 AM
 #5

It also appears that any "Pay To Many" transactions you may have sent, will also show up as separate records in listtransactions... so the "fee" will be shown twice and could throw off your calculations if you're not careful.

I just spent 5 minutes trying to figure out why my total was off by around 7000 sats Wink

Yep, that is the solution, thank you for your time!
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!