aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-03-08 18:47:41 +0200
committerRiccardo Spagni <ric@spagni.net>2018-03-08 18:47:41 +0200
commite9f41e405f1f75533ef6e9d5adc76ba41dd29e8c (patch)
tree33326d648cb18d70299e6d20a1028d53f10d8bdc /src
parentMerge pull request #3370 (diff)
parentBump min ring size from 5 to 7 from v7 (diff)
downloadmonero-e9f41e405f1f75533ef6e9d5adc76ba41dd29e8c.tar.xz
Merge pull request #3368
38657fd0 Bump min ring size from 5 to 7 from v7 (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_config.h1
-rw-r--r--src/cryptonote_core/blockchain.cpp2
-rw-r--r--src/simplewallet/simplewallet.cpp4
-rw-r--r--src/wallet/wallet2.cpp6
4 files changed, 9 insertions, 4 deletions
diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h
index 171fc194a..0ad8a6005 100644
--- a/src/cryptonote_config.h
+++ b/src/cryptonote_config.h
@@ -132,6 +132,7 @@
#define HF_VERSION_DYNAMIC_FEE 4
#define HF_VERSION_MIN_MIXIN_4 6
+#define HF_VERSION_MIN_MIXIN_6 7
#define HF_VERSION_ENFORCE_RCT 6
#define PER_KB_FEE_QUANTIZATION_DECIMALS 8
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index d88cc1bf9..c97b75f98 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -2531,7 +2531,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 >= HF_VERSION_MIN_MIXIN_4 ? 4 : 2;
+ const size_t min_mixin = hf_version >= HF_VERSION_MIN_MIXIN_6 ? 6 : hf_version >= HF_VERSION_MIN_MIXIN_4 ? 4 : 2;
for (const auto& txin : tx.vin)
{
// non txin_to_key inputs will be rejected below
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index c618869f2..cbb174e1a 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -86,9 +86,9 @@ typedef cryptonote::simple_wallet sw;
#define EXTENDED_LOGS_FILE "wallet_details.log"
-#define DEFAULT_MIX 4
+#define DEFAULT_MIX 6
-#define MIN_RING_SIZE 5 // Used to inform user about min ring size -- does not track actual protocol
+#define MIN_RING_SIZE 7 // Used to inform user about min ring size -- does not track actual protocol
#define OUTPUT_EXPORT_FILE_MAGIC "Monero output export\003"
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 4a6c6fad2..d845dd896 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -5089,7 +5089,11 @@ int wallet2::get_fee_algorithm() const
//------------------------------------------------------------------------------------------------------------------------------
uint64_t wallet2::adjust_mixin(uint64_t mixin) const
{
- if (mixin < 4 && use_fork_rules(6, 10)) {
+ if (mixin < 6 && use_fork_rules(7, 10)) {
+ MWARNING("Requested ring size " << (mixin + 1) << " too low for hard fork 7, using 7");
+ mixin = 6;
+ }
+ else if (mixin < 4 && use_fork_rules(6, 10)) {
MWARNING("Requested ring size " << (mixin + 1) << " too low for hard fork 6, using 5");
mixin = 4;
}