From 4f887dea6eb0ff1b72a829a503e1f4c1ec3d704e Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 14 Aug 2016 19:15:04 +0100 Subject: increase minimum mixin to 4 on hard fork 5 --- src/cryptonote_core/blockchain.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/cryptonote_core/blockchain.cpp') diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index c094d1bd9..8ff286145 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -2330,6 +2330,7 @@ bool Blockchain::check_tx_inputs(transaction& tx, tx_verification_context &tvc, { size_t n_unmixable = 0, n_mixable = 0; size_t mixin = std::numeric_limits::max(); + const size_t min_mixin = hf_version >= 5 ? 4 : 2; for (const auto& txin : tx.vin) { // non txin_to_key inputs will be rejected below @@ -2348,7 +2349,7 @@ bool Blockchain::check_tx_inputs(transaction& tx, tx_verification_context &tvc, uint64_t n_outputs = m_db->get_num_outputs(in_to_key.amount); LOG_PRINT_L2("output size " << print_money(in_to_key.amount) << ": " << n_outputs << " available"); // n_outputs includes the output we're considering - if (n_outputs <= 2) + if (n_outputs <= min_mixin) ++n_unmixable; else ++n_mixable; @@ -2358,7 +2359,7 @@ bool Blockchain::check_tx_inputs(transaction& tx, tx_verification_context &tvc, } } - if (mixin < 2) + if (mixin < min_mixin) { if (n_unmixable == 0) { -- cgit v1.2.3