GUI: display error when sending all coins #1452

issue Diapolo opened this issue on June 13, 2012
  1. Diapolo commented at 4:43 PM on June 13, 2012: none

    When I send all coins from my wallet the displayed balance on the overviewpage is not updated. After a restart it's fine. Seems like a missing SIGNAL-handling?

  2. laanwj commented at 5:48 PM on June 13, 2012: member

    Was the transaction shown in the transaction list? Did it generate a notification?

  3. Diapolo commented at 8:49 PM on June 13, 2012: none

    The transaction was shown imediately on overviewpage and in the transaction list and I received a notification-message.

  4. laanwj commented at 9:26 PM on June 13, 2012: member

    I don't understand what happened, then. The balances are recomputed and updated after every wallet update in WalletModel::updateTransaction. A spend immediately count towards the balance, so after the recompute the balance should have been 0. If the signal would have been lost, the transaction would have been completely invisible...

    Do we maybe special-case the balance "0" somewhere? Maybe there is somehow a bug that makes it impossible for the balance to go back to absolute zero?

    The way to test this (without actually spending) would be to inject into WalletModel

    emit balanceChanged(0, 0, 0);
    

    on a timer after a certain while.... (or some other way)

  5. Diapolo commented at 5:00 AM on June 14, 2012: none

    I'm going to try this later and will report back.

  6. Diapolo commented at 5:56 PM on June 14, 2012: none

    Strange tried it with the last official 0.6.2, which worked. Need to take another look at it with current master build.

  7. Diapolo commented at 6:41 PM on June 15, 2012: none

    @laanwj I was able to reproduce this again, had 0.955402 BTC in my wallet and sent them all to another address in a different wallet. The transaction was shown as tray-notification, is visible in the transaction-list and on the overviewpage. But the balance on overviewpage AND send coins still shows 0.955402 BTC.

    Block-chain was up-to-date before sending and I was on normal net. Used a custom build based on master. Can you perhaps try to re-create the scenario and test it out?

    Edit: The number of transactions was updated, too ... a client-restart leads to a display of the correct values for balance.

  8. Diapolo commented at 6:48 PM on June 15, 2012: none

    This is the part of the happening from the debug.log:

    <pre> 06/15/12 18:35:25 WalletUpdateSpent found spent coin 0.955402bc 8b842333c58e9a2320c49f585a3b08bc508ebf5e95ca07689e92c831bb994977 06/15/12 18:35:25 NotifyTransactionChanged 8b842333c58e9a2320c49f585a3b08bc508ebf5e95ca07689e92c831bb994977 status=1 06/15/12 18:35:25 NotifyTransactionChanged 3a327bc4c5a42c3ede3839213d5abe42a2dccf1189e8aedde4c68fb9452cdb59 status=0 06/15/12 18:35:25 NotifyTransactionChanged 8b842333c58e9a2320c49f585a3b08bc508ebf5e95ca07689e92c831bb994977 status=1 06/15/12 18:35:25 Rate limit dFreeCount: 3422.62 => 3614.62 06/15/12 18:35:25 CTxMemPool::accept() : accepted 3a327bc4c5 (poolsz 42) 06/15/12 18:35:25 Relaying wtx 3a327bc4c5 06/15/12 18:35:25 updateWallet 8b842333c58e9a2320c49f585a3b08bc508ebf5e95ca07689e92c831bb994977 1 06/15/12 18:35:25 inWallet=1 inModel=1 Index=25-26 showTransaction=1 derivedStatus=1 06/15/12 18:35:25 updateWallet 3a327bc4c5a42c3ede3839213d5abe42a2dccf1189e8aedde4c68fb9452cdb59 0 06/15/12 18:35:25 inWallet=1 inModel=0 Index=13-13 showTransaction=1 derivedStatus=0 06/15/12 18:35:25 updateWallet 8b842333c58e9a2320c49f585a3b08bc508ebf5e95ca07689e92c831bb994977 1 06/15/12 18:35:25 inWallet=1 inModel=1 Index=26-27 showTransaction=1 derivedStatus=1 </pre>

  9. Diapolo commented at 6:50 PM on June 15, 2012: none

    Can it be related to NotifyTransactionChanged() and the use of a Qt::QueuedConnection?

  10. laanwj commented at 8:21 PM on June 15, 2012: member

    No. The notification survives intact, otherwise you wouldn't get a notification at all and it wouldn't show up in the transaction list. The function you should watch is WalletModel::updateTransaction, the recomputation of the balance, and whether the balanceChanged(0,0,0) signal is emitted and processed correctly.

    Did you check what I proposed?

  11. Diapolo commented at 9:56 PM on June 24, 2012: none

    @laanwj I think this is related to the problem with immature balances display. I tried your suggestion and placed an emit balanceChanged(0, 0, 0); on a timer, which when fired, correctly updates the balance.

    Today I had the main problem again, sent all coins from the wallet (a Tx fee was included), got a tray-notification, Tx shows up in the list, but balance display on overviewpage doesn't change.

  12. Diapolo commented at 10:14 PM on July 7, 2012: none

    @laanwj Could this be resovled by #1559? I currently can't verify, because my build environment get's some updates (at least I'm trying to switch to GCC 4.7).

  13. laanwj commented at 7:51 AM on July 8, 2012: member

    I hope so. As it updates the balance with a timer, it should eventually get it right.

  14. Diapolo commented at 5:05 PM on July 8, 2012: none

    I can confirm this is fixed by #1559, so closing this!

  15. Diapolo closed this on Jul 8, 2012

  16. Diapolo reopened this on Jul 8, 2012

  17. Diapolo commented at 8:44 PM on July 8, 2012: none

    Sorry, I have to re-open, as on testnet, this was happening again.

  18. laanwj commented at 9:03 PM on July 8, 2012: member

    Need to check: does a sent transaction count toward the balance immediately or only after it was sent to a peer node?

    Seems like the only explanation I can think of that the new outgoing transaction is not taken into account in the balance computation afterwards.

  19. Diapolo commented at 9:06 PM on July 8, 2012: none

    Did you try out the testnet3? It is rather weird as currently I can't seem to get it fully synced (too many old nodes I guess). Perhaps this is related?

    Edit: Needs an outgoing Tx confirmations before it counts? I'm also not sure if the display was updated in the send-coins dialog (there is a small label for this).

  20. laanwj referenced this in commit 326d51b36b on Jul 10, 2012
  21. laanwj referenced this in commit 2e00b8fbd9 on Jul 11, 2012
  22. Diapolo commented at 11:45 AM on July 13, 2012: none

    Fixed by #1575, closing this!

  23. Diapolo closed this on Jul 13, 2012

  24. nifgraup referenced this in commit b1ce7afe5e on Mar 30, 2014
  25. suprnurd referenced this in commit b7822464f6 on Dec 5, 2017
  26. lateminer referenced this in commit c5755e5ac0 on Jan 22, 2019
  27. lateminer referenced this in commit a86ee0f271 on May 6, 2020
  28. 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-13 18:16 UTC

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