Incorrect balance reported in getwalletinfo/getbalance #21768

issue Crypto2 openend this issue on April 24, 2021
  1. Crypto2 commented at 0:08 am on April 24, 2021: none

    We’re having a problem where our balance keeps reporting lower and lower over time but if you restart bitcoind it’s back to normal. I’ve only seen it happen like 2-3x before but since the blockchain backed up last Friday it’s been worse and worse. We do have a fair amount of unconfirmed consolidation TXes from before the blockchain backed up with low fees set so I had kind of thought maybe it’s ignoring TXes with too low of a fee rate or something like that?

    I did find this report and maybe it is the same or related? #20943

  2. Crypto2 added the label Bug on Apr 24, 2021
  3. ghost commented at 0:38 am on April 24, 2021: none

    We’re having a problem where our balance keeps reporting lower and lower over time but if you restart bitcoind it’s back to normal.

    That’s weird. How do I reproduce this issue?

  4. Crypto2 commented at 6:03 am on April 24, 2021: none
    I wish I knew for sure, we normally would broadcast consolidation TXes at 4-8 sat/B which would be rejected by the mempool right now but even that it’s related to that is speculation on my part. I’m not seeing any errors in debug.log or anything.
  5. Crypto2 commented at 1:30 am on April 29, 2021: none
    I would say my initial feeling that it’s related to fees is right, as fees have come down and the mempool gotten smaller the balances have been coming back up close to normal.
  6. meshcollider commented at 12:38 pm on September 27, 2021: contributor

    Does your unconfirmed_balance field include the value that is missing from balance?

    Are the incoming transactions that haven’t been confirmed and have low fees visible in your wallet?

  7. Crypto2 commented at 5:26 am on September 29, 2021: none
    They aren’t in the unconfirmed_balance when it happens. I’m not sure if they are in listsinceblock/listtransactions or not but they aren’t in listunspent.
  8. adamjonas commented at 8:38 pm on March 9, 2023: member
    @Crypto2 can you attempt to reproduce with an updated version, please?
  9. Crypto2 commented at 9:14 pm on March 9, 2023: none
    Yep I’ll keep an eye on it if/when the network gets backed up like that again.
  10. adamjonas commented at 9:32 pm on March 9, 2023: member
    Mind if we close since we don’t have any reports from others? Can reopen if you can isolate it again.
  11. Crypto2 commented at 10:47 pm on March 9, 2023: none
    Go for it :)
  12. adamjonas closed this on Mar 10, 2023

  13. Crypto2 commented at 2:42 am on March 23, 2023: none

    It happened again today, sometime between 12-1pm Toronto time. If you look at the unconfirmed balance in this hourly log it just drops and it is ignoring those pending funds. I did restart the node but that didn’t fix it (and no they didn’t just go in to the confirmed balance.) listtransactions for that hour shows less than 1 BTC of volume in either direction.

    12a BTC: wallet 0 balances -> balance: X.30494649 / unconfirmed_balance: 22.45820421 BTC: wallet 0 balances -> balance: X.01931847 / unconfirmed_balance: 22.42169431 BTC: wallet 0 balances -> balance: X.62124410 / unconfirmed_balance: 22.11726200 BTC: wallet 0 balances -> balance: X.52626232 / unconfirmed_balance: 22.08649564 BTC: wallet 0 balances -> balance: X.66618209 / unconfirmed_balance: 22.04960200 BTC: wallet 0 balances -> balance: X.91105634 / unconfirmed_balance: 22.03329268 BTC: wallet 0 balances -> balance: X.78782991 / unconfirmed_balance: 22.04635732 BTC: wallet 0 balances -> balance: X.67208141 / unconfirmed_balance: 22.12968223 BTC: wallet 0 balances -> balance: X.07966213 / unconfirmed_balance: 22.36605969 BTC: wallet 0 balances -> balance: X.22794143 / unconfirmed_balance: 23.20283517 BTC: wallet 0 balances -> balance: X.32070014 / unconfirmed_balance: 22.26384256 BTC: wallet 0 balances -> balance: X.54562238 / unconfirmed_balance: 22.69560058 12p BTC: wallet 0 balances -> balance: X.49040721 / unconfirmed_balance: 22.42184574 1p BTC: wallet 0 balances -> balance: X.52444018 / unconfirmed_balance: 0.97467350 BTC: wallet 0 balances -> balance: X.31928108 / unconfirmed_balance: 0.45006238 BTC: wallet 0 balances -> balance: X.34068823 / unconfirmed_balance: 0.21795839 BTC: wallet 0 balances -> balance: X.72663008 / unconfirmed_balance: 0.35531039 BTC: wallet 0 balances -> balance: X.89314230 / unconfirmed_balance: 6.93429328 BTC: wallet 0 balances -> balance: X.66105831 / unconfirmed_balance: 0.24471168 BTC: wallet 0 balances -> balance: X.14756696 / unconfirmed_balance: 1.09266187 BTC: wallet 0 balances -> balance: X.48296655 / unconfirmed_balance: 0.22057386 BTC: wallet 0 balances -> balance: X.91874534 / unconfirmed_balance: 0.17656607 10p BTC: wallet 0 balances -> balance: X.85605202 / unconfirmed_balance: 0.26575806

    —————– Update —————– I tried increasing the maxmempool to 1000 instead of the default 300 and restarted again, and now the funds are showing again: BTC: wallet 0 balances -> balance: X.40440552 / unconfirmed_balance: 22.13993391

    So it does seem like it is related to trimming the mempool due to low fees, perhaps TXes to/from our own wallet should be prioritized to not be ejected from the mempool?

  14. ghost commented at 6:32 am on March 23, 2023: none

    I tried increasing the maxmempool to 1000 instead of the default 300 and restarted again, and now the funds are showing again

    Don’t use default mempool size if you have enough RAM on machine running bitcoind. Default was set years ago and doesn’t make sense anymore. There are other disadvantages as well for using default or lower size mempool.

  15. maflcko added the label Wallet on Mar 23, 2023
  16. maflcko added the label Mempool on Mar 23, 2023
  17. bitcoin locked this on Mar 22, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me