0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-09 10:43:19 -05:00
bitcoin-bitcoin-core/src/index
MarcoFalke e31cdb0238
Merge bitcoin/bitcoin#23411: refactor: Avoid integer overflow in ApplyStats when activating snapshot
fa996c58e8 refactor: Avoid integer overflow in ApplyStats when activating snapshot (MarcoFalke)
fac01888d1 Move AdditionOverflow to util, Add CheckedAdd with unit tests (MarcoFalke)
fa526d8fb6 Add dev doc to CCoinsStats::m_hash_type and make it const (MarcoFalke)
faff051560 style: Remove unused whitespace (MarcoFalke)

Pull request description:

  A snapshot contains the utxo set, including the out value. To activate the snapshot, the hash needs to be calculated. As a side-effect, the total amount in the snapshot is calculated (as the sum of all out values), but never used. Instead of running into an integer overflow in an unused result, don't calculate the result in the first place.

  Other code paths (using the active utxo set) can not run into an integer overflow, since the active utxo set is valid.

  Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39716

ACKs for top commit:
  shaavan:
    reACK fa996c58e8
  vasild:
    ACK fa996c58e8

Tree-SHA512: 4f207f634841f6f634fd02ae1e5907e343fd767524fd0e8149aa99fa9a1834fe50167d14874834d45236e9c325d567925f28129bacb7d80be29cf22277a16a14
2022-01-05 10:34:29 +01:00
..
base.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
base.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
blockfilterindex.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
blockfilterindex.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
coinstatsindex.cpp refactor: Avoid integer overflow in ApplyStats when activating snapshot 2021-12-17 10:47:31 +01:00
coinstatsindex.h scripted-diff: Fix coinstats data member names 2021-06-03 01:48:24 +02:00
disktxpos.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
txindex.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
txindex.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00