aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-02-15 10:20:23 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-02-15 10:20:23 +0000
commitbd7f82515b6e25818fc622e39e7a8fb948875f9f (patch)
tree512dea7feae7033951dced3b15bafbabc43a8564
parentMerge pull request #5147 (diff)
downloadmonero-bd7f82515b6e25818fc622e39e7a8fb948875f9f.tar.xz
blockchain: forbid older BP rct versions from v11
-rw-r--r--src/cryptonote_core/blockchain.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index ebae1466f..0b7482915 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -119,6 +119,9 @@ static const struct {
// version 10 starts from block 1788000, which is on or around the 9th of March, 2019. Fork time finalised on 2019-02-10.
{ 10, 1788000, 0, 1549792439 },
+
+ // version 11 starts from block 1788720, which is on or around the 10th of March, 2019. Fork time finalised on 2019-02-15.
+ { 11, 1788720, 0, 1550225678 },
};
static const uint64_t mainnet_hard_fork_version_1_till = 1009826;
@@ -144,6 +147,7 @@ static const struct {
{ 8, 1057058, 0, 1533211200 },
{ 9, 1057778, 0, 1533297600 },
{ 10, 1154318, 0, 1550153694 },
+ { 11, 1155038, 0, 1550225678 },
};
static const uint64_t testnet_hard_fork_version_1_till = 624633;
@@ -166,6 +170,7 @@ static const struct {
{ 8, 176456, 0, 1537821770 },
{ 9, 177176, 0, 1537821771 },
{ 10, 269000, 0, 1550153694 },
+ { 11, 269720, 0, 1550225678 },
};
//------------------------------------------------------------------
@@ -2428,7 +2433,19 @@ bool Blockchain::check_tx_outputs(const transaction& tx, tx_verification_context
if (tx.version >= 2) {
if (tx.rct_signatures.type == rct::RCTTypeBulletproof2)
{
- MERROR_VER("Bulletproofs v2 are not allowed before v" << HF_VERSION_SMALLER_BP);
+ MERROR_VER("Ringct type " << (unsigned)rct::RCTTypeBulletproof2 << " is not allowed before v" << HF_VERSION_SMALLER_BP);
+ tvc.m_invalid_output = true;
+ return false;
+ }
+ }
+ }
+
+ // from v11, allow only bulletproofs v2
+ if (hf_version > HF_VERSION_SMALLER_BP) {
+ if (tx.version >= 2) {
+ if (tx.rct_signatures.type == rct::RCTTypeBulletproof)
+ {
+ MERROR_VER("Ringct type " << (unsigned)rct::RCTTypeBulletproof << " is not allowed from v" << (HF_VERSION_SMALLER_BP + 1));
tvc.m_invalid_output = true;
return false;
}