Immature balance does not update correctly #1432

issue Dr-Nix opened this issue on June 8, 2012
  1. Dr-Nix commented at 5:46 PM on June 8, 2012: none

    I noticed that the new 'Immature balance' label is not updated correctly when they actually mature. In fact, also the normal 'balance' label is not updated correctly.

    Observed behavior:

    1. When starting bitcoin-qt all is well: The mined transactions below 120 confirmations are added and listed 'immature', the rest of the transactions are added and listed under 'balance'.
    2. When a block is received in which new coins are mined they are added to the 'immature balance'. So far so good.
    3. When a block is received pushing the number of confirmations of a mined transaction above 120, this transaction's icon is changed to a green V, but its value is not deducted from the immature balance, and it is also not added to the regular balance. The only way to have it display correctly is to restart bitcoin-qt, as then one goes to situation 1) again.

    Desired behavior: The labels should reflect the correct balance/immature balance at all times, according to the currently downloaded and verified (and matured) blocks.

  2. Diapolo commented at 12:15 AM on June 9, 2012: none

    I can confirm this behaviour.

  3. Diapolo commented at 12:19 AM on June 9, 2012: none

    #837 was the pull who introduced the Immature balance display.

  4. Diapolo commented at 5:29 PM on June 16, 2012: none

    I have a patch ready for this, but I'm not entirely sure about it. Perhaps another dev can take a look at it first! https://github.com/Diapolo/bitcoin/commit/04e75e4ab9e426b4b0c4e59196dbe5be127ad497

    I'm sure the current call to GetCredit(pcoin) can't be correct, as it does:

    <pre> if (IsCoinBase() && GetBlocksToMaturity() > 0) return 0; </pre>

    And this is the opposite of what we need for the immature coins, right?

  5. Diapolo commented at 12:19 AM on June 17, 2012: none

    I found out (via a matured amount of BTC), that the displayed balance is not updated correctly (after a client-restart the value is correct though), so I now added an update of the displayed balances on a changed block number.

    https://github.com/Diapolo/bitcoin/tree/GUI_fix_immature

    Can any developer comment if that makes sense for Bitcoin-Qt? When an immature balance matures, this involves just a changed block count and not a new transaction, right?

  6. Diapolo commented at 11:12 AM on June 22, 2012: none

    I seem to have a somehow related problem with official 0.6.3.RC1, which doesn't show unconfirmed balances, although I have a transacion that indeed should be added to unconfirmed balance. Can anyone confirm this?

  7. Diapolo commented at 12:29 PM on June 29, 2012: none

    @laanwj How is progress going for your fix to this issue? Would be a bad thing if this get's into 0.7 IMHO.

  8. laanwj commented at 12:30 PM on June 29, 2012: member

    I don't have much time to work on this at the moment.

  9. Diapolo commented at 12:32 PM on June 29, 2012: none

    I took a look, but when reaching the boost::signal stuff I was out ;). Too bad...

  10. laanwj commented at 12:37 PM on June 29, 2012: member

    You don't have to do anything with the boost::signal stuff.

    The only thing that is needed is a function like TransactionTableModel::updateConfirmations, called by a timer, in WalletModel, except that instead of the number of confirmations it recomputes the balances if the number of blocks changed.

    Only a few lines of code, really, I may get around to this in the weekend.

  11. Diapolo commented at 4:26 PM on July 5, 2012: none

    Reference to #1559.

  12. Diapolo commented at 2:45 PM on July 7, 2012: none

    This should be fixed and can be closed now!

  13. laanwj closed this on Aug 18, 2012

  14. suprnurd referenced this in commit b40f8f333c on Dec 5, 2017
  15. lateminer referenced this in commit f5f6c3cd92 on May 6, 2020
  16. MarcoFalke locked this on Sep 8, 2021

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: 2026-04-15 15:15 UTC

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