Addition of ImmatureCreditCached to MarkDirty() #8703

pull SCDeveloper wants to merge 1 commits into bitcoin:master from SCDeveloper:patch-5 changing 1 files +1 −0
  1. SCDeveloper commented at 12:18 AM on September 12, 2016: none

    No description provided.

  2. Addition of ImmatureCreditCached to MarkDirty() 27c8015b31
  3. SCDeveloper commented at 12:18 AM on September 12, 2016: none

    Why is this not added here? Yet ImmatureWatchCreditCached is? Mistake or is there a reason for it not being here?

  4. fanquake added the label Wallet on Sep 12, 2016
  5. jonasschnelli commented at 9:34 AM on September 12, 2016: contributor

    @SCDeveloper: can you elaborate what this change is trying to fix?

  6. SCDeveloper commented at 12:54 PM on September 12, 2016: none

    I am asking if it is missing in the first place.

  7. SCDeveloper commented at 2:37 PM on September 13, 2016: none

    Can anyone elaborate why it isn't in MarkDirty()????

  8. laanwj commented at 3:40 PM on September 13, 2016: member

    Looks like fImmatureCreditCached is never cleared except when the transaction is initialized. I don't think that is correct, unless it can never change.

  9. SCDeveloper commented at 4:57 PM on September 13, 2016: none

    I would of thought it would be best to have it in MarkDirty(), I have it currently within my code I am due to release shortly (Silk(SLK) & DarkSilk(DSLK)) and have no issues. I just don't understand why Bitcoin doesn't have it there?

  10. morcos commented at 6:29 PM on September 13, 2016: member

    utACK.

    I certainly don't think it hurts to put it in MarkDirty and it makes more logical sense. I don't think it'll actually change behavior though since GetImmatureCredit returns 0 instead of accessing the cache if this test fails: if (IsCoinBase() && GetBlocksToMaturity() > 0 && IsInMainChain()) and I can't see as how the amount of the immature credit could change otherwise.

  11. SCDeveloper commented at 7:27 PM on September 13, 2016: none

    I think it is just safer and more logical to have it covered than to not.

  12. sipa commented at 9:24 PM on September 13, 2016: member

    The only reason why an immature balance cached value can get invalidated is when the longest chain length decreases, which is an exceedingly rare and hard thing in Bitcoin mainnet (it requires a massive reorg crossing a retarget, with large time difference).

    However, agree, for consistency and obviousness of correctness, utACK.

  13. SCDeveloper commented at 9:50 PM on September 13, 2016: none

    If people wouldnt mind I would like to recommit this under my public identity.

  14. spencerlievens commented at 9:58 PM on September 13, 2016: contributor

    Im forking the code now to recommit @sipa (SCDeveloper is another identity but for this I want to use my public identity). GitHub is really slow today.

  15. spencerlievens commented at 10:30 PM on September 13, 2016: contributor
  16. SCDeveloper commented at 10:31 PM on September 13, 2016: none

    Please see link above

  17. SCDeveloper closed this on Sep 13, 2016

  18. DrahtBot 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-21 15:15 UTC

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