From 44398690d1d4c3f63b9fefc88b9f7ae589f4c8a0 Mon Sep 17 00:00:00 2001 From: furszy Date: Wed, 15 May 2019 01:13:52 +0200 Subject: [PATCH] [zPIV][Consensus] reject V1 serials spends. --- src/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index acfac7b0566e4..0349986218044 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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__,