aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-08 13:49:42 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-08-28 21:30:14 +0100
commit3ab2ab3e7691dadf91ef39ed477e12f0144b8278 (patch)
tree4ca65b04438221bc8398f0ae8b5f40b95abfaad2 /src/cryptonote_core/blockchain.cpp
parentrct: avoid the need for the last II element (diff)
downloadmonero-3ab2ab3e7691dadf91ef39ed477e12f0144b8278.tar.xz
rct: change the simple flag to a type
for future expansion
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r--src/cryptonote_core/blockchain.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index 91a9d5d6f..c81445f1d 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -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;