Skip to content

Commit

Permalink
[zPIV][Consensus] reject V1 serials spends.
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed May 23, 2019
1 parent cb4ffa1 commit 4439869
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,9 +1042,13 @@ bool ContextualCheckZerocoinSpendNoSerialCheck(const CTransaction& tx, const Coi
}
}

//Reject V1 old serials.
if (spend->getVersion() < libzerocoin::PrivateCoin::PUBKEY_VERSION) {
return error("%s : zPIV v1 serial spend not spendable\n", __func__,
spend->getCoinSerialNumber().GetHex(), tx.GetHash().GetHex());
}
//Reject serial's that are not in the acceptable value range
bool fUseV1Params = spend->getVersion() < libzerocoin::PrivateCoin::PUBKEY_VERSION;
if (!spend->HasValidSerial(Params().Zerocoin_Params(fUseV1Params))) {
if (!spend->HasValidSerial(Params().Zerocoin_Params(false))) {
// Up until this block our chain was not checking serials correctly..
if (!isBlockBetweenFakeSerialAttackRange(pindex->nHeight))
return error("%s : zPIV spend with serial %s from tx %s is not in valid range\n", __func__,
Expand Down

0 comments on commit 4439869

Please sign in to comment.