Skip to content

Commit

Permalink
Assert that zerocoinDenomList is size 8.
Browse files Browse the repository at this point in the history
Prevent any future development from forgetting to update the checkpointing process if the denom list changes.
  • Loading branch information
presstab committed Nov 6, 2017
1 parent cc9fbf2 commit 26f28d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/accumulatormap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ CBigNum AccumulatorMap::GetValue(CoinDenomination denom)
uint256 AccumulatorMap::GetCheckpoint()
{
uint256 nCheckpoint;

//Prevent possible overflows from future changes to the list and forgetting to update this code
assert(zerocoinDenomList.size() == 8);
for (auto& denom : zerocoinDenomList) {
CBigNum bnValue = mapAccumulators.at(denom)->getValue();
uint32_t nCheckSum = GetChecksum(bnValue);
Expand Down

0 comments on commit 26f28d6

Please sign in to comment.