Skip to content

Commit

Permalink
Merge #408: Fix "accumulator does not verify" when spending zPIV.
Browse files Browse the repository at this point in the history
9191e19 Fix "accumulator does not verify" when spending zPIV. (presstab)

Tree-SHA512: db6cbbffc4b4aa103980896a51a52ac903d95a5772a97969c92e4aeebf4d040a231061ead15b89cb5435af80bc0587cd4ba92cca72586b03ef10d92617857a54
  • Loading branch information
Mrs-X committed Nov 24, 2017
2 parents 84e0dc3 + 9191e19 commit beae959
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/accumulators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,10 @@ bool GenerateAccumulatorWitness(const PublicCoin &coin, Accumulator& accumulator
if (pindex->nHeight % 10 == 0) {
nChanges++;

if (nChanges == 1)
if (nChanges == 1) {
nCheckpointBeforeMint = pindex->nAccumulatorCheckpoint;
break;
}
}
pindex = chainActive.Next(pindex);
}
Expand Down Expand Up @@ -342,7 +344,7 @@ bool GenerateAccumulatorWitness(const PublicCoin &coin, Accumulator& accumulator

//if a new checkpoint was generated on this block, and we have added the specified amount of checkpointed accumulators,
//then initialize the accumulator at this point and break
if (!InvalidCheckpointRange(pindex->nHeight) && (pindex->nHeight == nHeightStop || (nSecurityLevel != 100 && nCheckpointsAdded >= nSecurityLevel))) {
if (!InvalidCheckpointRange(pindex->nHeight) && (pindex->nHeight >= nHeightStop || (nSecurityLevel != 100 && nCheckpointsAdded >= nSecurityLevel))) {
uint32_t nChecksum = ParseChecksum(chainActive[pindex->nHeight + 10]->nAccumulatorCheckpoint, coin.getDenomination());
CBigNum bnAccValue = 0;
if (!zerocoinDB->ReadAccumulatorValue(nChecksum, bnAccValue)) {
Expand Down

0 comments on commit beae959

Please sign in to comment.