mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 18:22:57 +02:00
index: Fix coinstatsindex overflow issue
The index originally stored cumulative values in a CAmount type but this allowed for potential overflow issues which were observed on Signet. Fix this by storing the values that are in danger of overflowing in a arith_uint256. Also turns an unnecessary copy into a reference in RevertBlock and CustomAppend and gets rid of the explicit total unspendable tracking which can be calculated by adding the four categories of unspendables together.
This commit is contained in:
@@ -128,7 +128,7 @@ class InitTest(BitcoinTestFramework):
|
||||
'startup_args': ['-txindex=1'],
|
||||
},
|
||||
# Removing these files does not result in a startup error:
|
||||
# 'indexes/blockfilter/basic/*.dat', 'indexes/blockfilter/basic/db/*.*', 'indexes/coinstats/db/*.*',
|
||||
# 'indexes/blockfilter/basic/*.dat', 'indexes/blockfilter/basic/db/*.*', 'indexes/coinstatsindex/db/*.*',
|
||||
# 'indexes/txindex/*.log', 'indexes/txindex/CURRENT', 'indexes/txindex/LOCK'
|
||||
]
|
||||
|
||||
@@ -154,7 +154,7 @@ class InitTest(BitcoinTestFramework):
|
||||
'startup_args': ['-blockfilterindex=1'],
|
||||
},
|
||||
{
|
||||
'filepath_glob': 'indexes/coinstats/db/*.*',
|
||||
'filepath_glob': 'indexes/coinstatsindex/db/*.*',
|
||||
'error_message': 'LevelDB error: Corruption',
|
||||
'startup_args': ['-coinstatsindex=1'],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user