diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-14 19:15:04 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-28 21:30:33 +0100 |
commit | 4f887dea6eb0ff1b72a829a503e1f4c1ec3d704e (patch) | |
tree | 29d38ed342b98bdfaeb8400186488829e76993aa | |
parent | core: allow v1 txes after HF 5 when sweeping unmixable outputs (diff) | |
download | monero-4f887dea6eb0ff1b72a829a503e1f4c1ec3d704e.tar.xz |
increase minimum mixin to 4 on hard fork 5
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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<size_t>::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) { |