Skip to content

Commit e458733

Browse files
committed
FCMP++ <> Carrot, BP+ <> Legacy
1 parent 9737c75 commit e458733

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/cryptonote_basic/cryptonote_format_utils.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,17 @@ namespace cryptonote
10091009
<< "expected matching variant types in transaction id=" << get_transaction_hash(tx));
10101010
}
10111011
}
1012+
1013+
// during v17, require non-coinbase carrot txs use FCMP++ and legacy use BP+
1014+
if (hf_version == HF_VERSION_CARROT && !cryptonote::is_coinbase(tx) && tx.vout.size())
1015+
{
1016+
const auto &o = tx.vout.front();
1017+
CHECK_AND_ASSERT_MES(
1018+
(o.target.type() == typeid(txout_to_carrot_v1) && tx.rct_signatures.type == rct::RCTTypeFcmpPlusPlus) ||
1019+
(o.target.type() == typeid(txout_to_tagged_key) && tx.rct_signatures.type == rct::RCTTypeBulletproofPlus),
1020+
false, "mismatched output type to tx proof type in transaction id=" << get_transaction_hash(tx));
1021+
}
1022+
10121023
return true;
10131024
}
10141025
//---------------------------------------------------------------

0 commit comments

Comments
 (0)