Skip to content

Commit

Permalink
correct bulletproofs versioning error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptochangements34 committed Jul 22, 2019
1 parent fdb764b commit f8f2b89
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/cryptonote_core/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2620,26 +2620,26 @@ bool Blockchain::check_tx_outputs(const transaction& tx, tx_verification_context
}
}

// from v8, allow bulletproofs
// from v5, allow bulletproofs
if (hf_version < 4) {
if (tx.version >= 2) {
const bool bulletproof = rct::is_rct_bulletproof(tx.rct_signatures.type);
if (bulletproof || !tx.rct_signatures.p.bulletproofs.empty())
{
MERROR_VER("Bulletproofs are not allowed before v8");
MERROR_VER("Bulletproofs are not allowed before v5");
tvc.m_invalid_output = true;
return false;
}
}
}

// from v9, forbid borromean range proofs
// from v6, forbid borromean range proofs
if (hf_version > 5) {
if (tx.version >= 2) {
const bool borromean = rct::is_rct_borromean(tx.rct_signatures.type);
if (borromean)
{
MERROR_VER("Borromean range proofs are not allowed after v8");
MERROR_VER("Borromean range proofs are not allowed after v5");
tvc.m_invalid_output = true;
return false;
}
Expand Down Expand Up @@ -3130,7 +3130,7 @@ bool Blockchain::check_tx_inputs(transaction& tx, tx_verification_context &tvc,
{
if (proof.V.size() > 1)
{
MERROR_VER("Multi output bulletproofs are invalid before v8");
MERROR_VER("Multi output bulletproofs are invalid before v5");
return false;
}
}
Expand Down

0 comments on commit f8f2b89

Please sign in to comment.