Possible inconsistency issue in CCoinsViewCache #12964

issue stevenroose opened this issue on April 12, 2018
  1. stevenroose commented at 7:27 AM on April 12, 2018: contributor

    I'm not very familiar with the code, but reading CCoinsViewCache::AddCoin, I noticed something that might cause inconsistency: https://github.com/bitcoin/bitcoin/blob/2fc94370f510f6d1fbd7a6a6cdedf2b14a3e9fb2/src/coins.cpp#L74

    The memory usage of the old element is subtracted, even though it's possible to raise an error lateron, leaving the original element in place.

    I might be missing something, though.

  2. sipa commented at 7:35 AM on April 12, 2018: member

    If you mean that std::logic_error, that's not a concern. It's effectively an assertion failure that will terminate the program immediately. It's just implemented as an exception to aid testing.

  3. stevenroose commented at 9:07 AM on April 12, 2018: contributor

    Oh, yeah I wasn't familiar with that. Thanks for pointing out.

  4. stevenroose closed this on Apr 12, 2018

  5. MarcoFalke 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 18:15 UTC

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