diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-10-18 15:38:44 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-10-18 15:44:57 +0200 |
commit | cdfb7755a6af2e95e8598ca8e8d6896c745bcd72 (patch) | |
tree | fce0cfa5a1d83ef5f9c6f84a6f0875bf1903323f /src/policy | |
parent | 0306978394dbf96d07e61cde5fb7240d29706361 (diff) | |
parent | 5eaaa83ac1f5eb525f93e2808fafd73f5ed97013 (diff) |
Merge #8914: Kill insecure_random and associated global state
5eaaa83 Kill insecure_random and associated global state (Wladimir J. van der Laan)
Diffstat (limited to 'src/policy')
-rw-r--r-- | src/policy/fees.cpp | 2 | ||||
-rw-r--r-- | src/policy/fees.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index 7b0e8b7d08..c07cd2eff8 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -594,7 +594,7 @@ FeeFilterRounder::FeeFilterRounder(const CFeeRate& minIncrementalFee) CAmount FeeFilterRounder::round(CAmount currentMinFee) { std::set<double>::iterator it = feeset.lower_bound(currentMinFee); - if ((it != feeset.begin() && insecure_rand() % 3 != 0) || it == feeset.end()) { + if ((it != feeset.begin() && insecure_rand.rand32() % 3 != 0) || it == feeset.end()) { it--; } return *it; diff --git a/src/policy/fees.h b/src/policy/fees.h index 463f62f710..2c1ac3b934 100644 --- a/src/policy/fees.h +++ b/src/policy/fees.h @@ -7,6 +7,7 @@ #include "amount.h" #include "uint256.h" +#include "random.h" #include <map> #include <string> @@ -298,5 +299,6 @@ public: private: std::set<double> feeset; + FastRandomContext insecure_rand; }; #endif /*BITCOIN_POLICYESTIMATOR_H */ |