@@ -739,7 +739,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason)
739739 }
740740
741741 for (const CTxIn& txin : tx.vin ) {
742- if (txin.IsZerocoinSpend ())
742+ if (txin.IsZerocoinSpend () || txin. IsZerocoinPublicSpend () )
743743 continue ;
744744 // Biggest 'standard' txin is a 15-of-15 P2SH multisig with compressed
745745 // keys. (remember the 520 byte limit on redeemScript size) That works
@@ -1042,16 +1042,17 @@ bool ContextualCheckZerocoinSpendNoSerialCheck(const CTransaction& tx, const Coi
10421042 }
10431043 }
10441044
1045+ bool v1Serial = spend->getVersion () < libzerocoin::PrivateCoin::PUBKEY_VERSION;
10451046 if (pindex->nHeight >= Params ().Zerocoin_Block_Public_Spend_Enabled ()) {
10461047 // Reject V1 old serials.
1047- if (spend-> getVersion () < libzerocoin::PrivateCoin::PUBKEY_VERSION ) {
1048+ if (v1Serial ) {
10481049 return error (" %s : zPIV v1 serial spend not spendable, serial %s, tx %s\n " , __func__,
10491050 spend->getCoinSerialNumber ().GetHex (), tx.GetHash ().GetHex ());
10501051 }
10511052 }
10521053
10531054 // Reject serial's that are not in the acceptable value range
1054- if (!spend->HasValidSerial (Params ().Zerocoin_Params (false ))) {
1055+ if (!spend->HasValidSerial (Params ().Zerocoin_Params (v1Serial ))) {
10551056 // Up until this block our chain was not checking serials correctly..
10561057 if (!isBlockBetweenFakeSerialAttackRange (pindex->nHeight ))
10571058 return error (" %s : zPIV spend with serial %s from tx %s is not in valid range\n " , __func__,
@@ -1817,15 +1818,13 @@ bool AcceptableInputs(CTxMemPool& pool, CValidationState& state, const CTransact
18171818
18181819bool GetOutput (const uint256& hash, unsigned int index, CValidationState& state, CTxOut& out)
18191820{
1820- libzerocoin::ZerocoinParams* params = Params ().Zerocoin_Params (false );
1821- PublicCoinSpend ret (params);
18221821 CTransaction txPrev;
18231822 uint256 hashBlock;
18241823 if (!GetTransaction (hash, txPrev, hashBlock, true )) {
18251824 return state.DoS (100 , error (" Output not found" ));
18261825 }
18271826 if (index > txPrev.vout .size ()) {
1828- return state.DoS (100 , error (" Output not found, invalid index %d" , index));
1827+ return state.DoS (100 , error (" Output not found, invalid index %d for %s " , index, hash. GetHex () ));
18291828 }
18301829 out = txPrev.vout [index];
18311830 return true ;
0 commit comments