Fee added to the immature block is lost in getbalance #333

issue gavinandresen opened this issue on June 20, 2011
  1. gavinandresen commented at 12:53 AM on June 20, 2011: contributor

    Anyone can replicate this issue :

    00:23:40 <MrSam> ok 00:23:47 <MrSam> i'm testing this on testnet-in-a-box with 2 nodes 00:23:55 <MrSam> a has 3650 / balance B has 0 00:24:14 <MrSam> i send 3600 from A to B with transaction fee cost of 9 00:24:28 <MrSam> so A now has balance of 41 and B will get 3600

    00:24:44 <MrSam> i then start the miner on a and i get a immature block with amount 59

    00:24:58 <MrSam> so i should have a balance of 100 00:25:05 <MrSam> but if i run getbalance i see 91

    9 btc is lost. Either the balance on A should still be 41 and not include the immature block, or 100 if it includes it. Never 91.

    client A: balance = 3650 listtransactions {
    "account" : "", "address" : "mjvtoRo55x4rfSftjAJcyKvpVkgi4LEDVD", "category" : "send", "amount" : -3600.00000000, "fee" : -9.00000000, "confirmations" : 1, "txid" : "a8ff67cfe52ec04ed0b988419d2144077cb918cb889f9e4498b6a5fb0e63b18d", "time" : 1308521616 }, {
    "account" : "", "category" : "immature", "amount" : 59.00000000, "confirmations" : 1, "txid" : "1b504ca8c8f200c5d37b1095902b7610b10484b6b608e48bbfe2411c69d480a5", "time" : 1308521869 } ]

    getbalance 91.00000000

    client B listtransactions { "account" : "getfrom1", "address" : "mjvtoRo55x4rfSftjAJcyKvpVkgi4LEDVD", "category" : "receive", "amount" : 3600.00000000, "confirmations" : 1, "txid" : "a8ff67cfe52ec04ed0b988419d2144077cb918cb889f9e4498b6a5fb0e63b18d", "time" : 1308521869 }

    getbalance 3600.00000000

  2. MrSam commented at 10:51 AM on June 20, 2011: none

    This issue can be closed.

    Testnet-in-a-box starts with some blocks allready mined, but still "immature". In my issue i send money from one account to another with a transaction fee, i then mine the block and get the transaction fee back, but it is still immature and not added to the balance.

    But by mining, i also validate an older immature block that now gets validaded so 50 BTC is added.

    It seems that the transaction fee is lost, but the block needs 119 more validations before the transaction fee is recuperated.

  3. gavinandresen commented at 11:37 AM on June 20, 2011: contributor

    That makes sense; the txn fee will be in limbo for 119 blocks. Closing.

  4. gavinandresen closed this on Jun 20, 2011

  5. dexX7 referenced this in commit 8cbc6d3794 on Jan 5, 2016
  6. ptschip referenced this in commit b9179647da on Mar 6, 2017
  7. destenson referenced this in commit 37e8f4707f on Nov 18, 2017
  8. classesjack referenced this in commit d344a37da5 on Jan 2, 2018
  9. lateminer referenced this in commit b7422097da on Oct 16, 2019
  10. rajarshimaitra referenced this in commit 4ef86ddcdf on Aug 5, 2021
  11. DrahtBot locked this on Sep 8, 2021
Contributors

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-05-02 15:16 UTC

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