rct: change the simple flag to a type

for future expansion
This commit is contained in:
moneromooo-monero
2016-08-08 13:49:42 +01:00
parent c5be4b0bea
commit 3ab2ab3e76
8 changed files with 46 additions and 25 deletions

View File

@@ -2464,8 +2464,9 @@ bool Blockchain::check_tx_inputs(const transaction& tx, tx_verification_context
// from version 2, check ringct signatures
// obviously, the original and simple rct APIs use a mixRing that's indexes
// in opposite orders, because it'd be too simple otherwise...
if (tx.rct_signatures.simple)
switch (tx.rct_signatures.type)
{
case rct::RCTTypeSimple: {
rct::ctkeyM reconstructed_mixRing;
std::vector<rct::keyV> reconstructed_II;
rct::ctkeyV reconstructed_outPk;
@@ -2568,9 +2569,9 @@ bool Blockchain::check_tx_inputs(const transaction& tx, tx_verification_context
LOG_PRINT_L1("Failed to check ringct signatures!");
return false;
}
break;
}
else
{
case rct::RCTTypeFull: {
rct::ctkeyM reconstructed_mixRing;
rct::keyV reconstructed_II;
rct::ctkeyV reconstructed_outPk;
@@ -2674,6 +2675,11 @@ bool Blockchain::check_tx_inputs(const transaction& tx, tx_verification_context
LOG_PRINT_L1("Failed to check ringct signatures!");
return false;
}
break;
}
default:
LOG_PRINT_L1("Unsupported rct type: " << tx.rct_signatures.type);
return false;
}
}
return true;