diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-11-14 15:20:45 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-11-14 15:20:45 +0200 |
commit | 25b97ee93742daaa41dd81d81e8a0ac1204b078e (patch) | |
tree | ea6a83679e2ff3174b6a78bb3bb21152e50671dd /src/wallet/wallet2.cpp | |
parent | Merge pull request #2720 (diff) | |
parent | simplewallet: forbid 0 ring size (diff) | |
download | monero-25b97ee93742daaa41dd81d81e8a0ac1204b078e.tar.xz |
Merge pull request #2624
2677ade5 simplewallet: forbid 0 ring size (moneromooo-monero)
da8b60cb simplewallet: reject attempts to use too low mixin early (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r-- | src/wallet/wallet2.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index ae4af99f6..5467ea7cb 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -3981,6 +3981,19 @@ int wallet2::get_fee_algorithm() return 1; return 0; } +//------------------------------------------------------------------------------------------------------------------------------ +uint64_t wallet2::adjust_mixin(uint64_t mixin) +{ + if (mixin < 4 && use_fork_rules(6, 10)) { + MWARNING("Requested ring size " << (mixin + 1) << " too low for hard fork 6, using 5"); + mixin = 4; + } + else if (mixin < 2 && use_fork_rules(2, 10)) { + MWARNING("Requested ring size " << (mixin + 1) << " too low for hard fork 2, using 3"); + mixin = 2; + } + return mixin; +} //---------------------------------------------------------------------------------------------------- // separated the call(s) to wallet2::transfer into their own function // |