diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp index fca10dfca..fc33a7fb8 100644 --- a/src/cryptonote_basic/cryptonote_format_utils.cpp +++ b/src/cryptonote_basic/cryptonote_format_utils.cpp @@ -146,7 +146,7 @@ namespace cryptonote if (!base_only) { const bool bulletproof = rct::is_rct_bulletproof(rv.type); - if (bulletproof && rv.type == rct::RCTTypeBulletproof) + if (rct::is_rct_new_bulletproof(rv.type)) { if (rv.p.bulletproofs.size() != 1) { @@ -415,7 +415,7 @@ namespace cryptonote const size_t n_outputs = tx.vout.size(); if (n_outputs <= 2) return blob_size; - if (rv.type != rct::RCTTypeBulletproof) + if (rct::is_rct_old_bulletproof(rv.type)) return blob_size; const uint64_t bp_base = 368; const size_t n_padded_outputs = rct::n_bulletproof_max_amounts(rv.p.bulletproofs); diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index c17899c91..3175ad89c 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -808,7 +808,7 @@ namespace cryptonote if (tx.version >= 2) { rct::rctSig &rv = tx.rct_signatures; - if (rv.type != rct::RCTTypeBulletproof){ + if (!rct::is_rct_new_bulletproof(rv.type)){ if (rv.outPk.size() != tx.vout.size()) { LOG_PRINT_L1("WRONG TRANSACTION BLOB, Bad outPk size in tx " << tx_hash << ", rejected"); diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp index 6b50e2a67..1f4cf3082 100644 --- a/src/ringct/rctSigs.cpp +++ b/src/ringct/rctSigs.cpp @@ -1099,7 +1099,7 @@ namespace rct { tools::threadpool::waiter waiter; std::deque results(bulletproof ? rv.p.bulletproofs.size() : rv.outPk.size(), false); DP("range proofs verified?"); - if (bulletproof && rv.type == RCTTypeBulletproof) + if (rct::is_rct_new_bulletproof(rv.type)) { for (size_t i = 0; i < rv.p.bulletproofs.size(); i++) tpool.submit(&waiter, [&, i] { results[i] = verBulletproof(rv.p.bulletproofs[i]); }); @@ -1232,7 +1232,7 @@ namespace rct { for (const rctSig *rvp: rvv) { const rctSig &rv = *rvp; - if (rv.type != RCTTypeBulletproof){ + if (!rct::is_rct_new_bulletproof(rv.type)){ if (!proofs.empty() && !verBulletproof_old(proofs)) { LOG_PRINT_L1("Aggregate range proof verified failed"); diff --git a/src/ringct/rctTypes.cpp b/src/ringct/rctTypes.cpp index 74bf7ff6b..be4ebec92 100644 --- a/src/ringct/rctTypes.cpp +++ b/src/ringct/rctTypes.cpp @@ -251,6 +251,11 @@ namespace rct { } } + bool is_rct_new_bulletproof(int type) + { + return is_rct_bulletproof(type) && !is_rct_old_bulletproof(type); + } + bool is_rct_borromean(int type) { switch (type) diff --git a/src/ringct/rctTypes.h b/src/ringct/rctTypes.h index 399f19f36..97ffe3f96 100644 --- a/src/ringct/rctTypes.h +++ b/src/ringct/rctTypes.h @@ -574,6 +574,7 @@ namespace rct { bool is_rct_simple(int type); bool is_rct_bulletproof(int type); bool is_rct_old_bulletproof(int type); + bool is_rct_new_bulletproof(int type); bool is_rct_borromean(int type); static inline const rct::key &pk2rct(const crypto::public_key &pk) { return (const rct::key&)pk; } diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 235deffa2..e627658e2 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -9177,7 +9177,7 @@ std::vector wallet2::create_transactions_2(std::vector wallet2::create_transactions_from(const crypton const bool bulletproof = use_fork_rules(get_bulletproof_fork(), 0); const rct::RCTConfig rct_config { bulletproof ? rct::RangeProofPaddedBulletproof : rct::RangeProofBorromean, - bulletproof ? (use_fork_rules(12, 0) ? 1 : 2) : 0, + bulletproof ? (use_fork_rules(HF_VERSION_SMALLER_BP, -10) ? 2 : 1) : 0 }; const uint64_t base_fee = get_base_fee(); const uint64_t fee_multiplier = get_fee_multiplier(priority, get_fee_algorithm());