Age | Commit message (Collapse) | Author |
|
|
|
when activating snapshot
fa996c58e8a31ebe610d186cef408b6dd3b385a8 refactor: Avoid integer overflow in ApplyStats when activating snapshot (MarcoFalke)
fac01888d17423d6c23a9ce15d98fc88fb34e3cc Move AdditionOverflow to util, Add CheckedAdd with unit tests (MarcoFalke)
fa526d8fb6ab8f2678a30d4536aa9c45218f5269 Add dev doc to CCoinsStats::m_hash_type and make it const (MarcoFalke)
faff051560552d4405896e01920a18f698155a56 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 fa996c58e8a31ebe610d186cef408b6dd3b385a8
vasild:
ACK fa996c58e8a31ebe610d186cef408b6dd3b385a8
Tree-SHA512: 4f207f634841f6f634fd02ae1e5907e343fd767524fd0e8149aa99fa9a1834fe50167d14874834d45236e9c325d567925f28129bacb7d80be29cf22277a16a14
|
|
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
Commits of previous years:
* 2020: fa0074e2d82928016a43ca408717154a1c70a4db
* 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
|
|
|
|
|
|
Move amount.h to consensus/amount.h.
Renames, adds missing and removes uneeded includes.
|
|
|
|
Initially these values were 'per block' in an earlier version but were then changed to total values. The names were not updated to reflect that.
-BEGIN VERIFY SCRIPT-
s() { git grep -l "$1" src | xargs sed -i "s/$1/$2/g"; }
s 'm_block_unspendable_amount' 'm_total_unspendable_amount'
s 'm_block_prevout_spent_amount' 'm_total_prevout_spent_amount'
s 'm_block_new_outputs_ex_coinbase_amount' 'm_total_new_outputs_ex_coinbase_amount'
s 'm_block_coinbase_amount' 'm_total_coinbase_amount'
s 'block_unspendable_amount' 'total_unspendable_amount'
s 'block_prevout_spent_amount' 'total_prevout_spent_amount'
s 'block_new_outputs_ex_coinbase_amount' 'total_new_outputs_ex_coinbase_amount'
s 'block_coinbase_amount' 'total_coinbase_amount'
s 'unspendables_genesis_block' 'total_unspendables_genesis_block'
s 'unspendables_bip30' 'total_unspendables_bip30'
s 'unspendables_scripts' 'total_unspendables_scripts'
s 'unspendables_unclaimed_rewards' 'total_unspendables_unclaimed_rewards'
s 'm_unspendables_genesis_block' 'm_total_unspendables_genesis_block'
s 'm_unspendables_bip30' 'm_total_unspendables_bip30'
s 'm_unspendables_scripts' 'm_total_unspendables_scripts'
s 'm_unspendables_unclaimed_rewards' 'm_total_unspendables_unclaimed_rewards'
-END VERIFY SCRIPT-
|
|
|
|
|
|
|
|
The index holds the values previously calculated in coinstats.cpp
for each block, representing the state of the UTXO set at each
height.
|
|
|
|
|
|
|
|
Also small style fix in rpc/util.cpp
|
|
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
|
|
|
|
|
|
Also, add interruption points to scantxoutset
|
|
Also changes existing CCoinsStats attributes to be C++11 initialized.
|
|
These procedures will later be used in the ChainstateManager to compute
statistics (particularly a content hash) for UTXO sets coming in from
snapshots.
|