aboutsummaryrefslogtreecommitdiffstats
path: root/src/base.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-07-01 21:09:54 +0000
committerlloyd <[email protected]>2006-07-01 21:09:54 +0000
commit6d3a4de1efcb6b04a1ab87037d487f979d7ca445 (patch)
tree02342b193a3808d2010b441480f65aa45a23dc92 /src/base.cpp
parent3d1d14cf405111e30643cf4c7674d441cc07a2e0 (diff)
Access the global configuration through an object reference instead
of stand-alone functions. Store the configuration in a distinct object, rather than just a map inside the library state.
Diffstat (limited to 'src/base.cpp')
-rw-r--r--src/base.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/base.cpp b/src/base.cpp
index 839829ba5..678640fd6 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -221,12 +221,13 @@ void RandomNumberGenerator::add_entropy(const byte random[], u32bit length)
u32bit RandomNumberGenerator::add_entropy(EntropySource& source,
bool slow_poll)
{
- u32bit poll_for = 0;
-
+ std::string poll_type;
if(slow_poll)
- poll_for = Config::get_u32bit("rng/slow_poll_request");
+ poll_type = "rng/slow_poll_request";
else
- poll_for = Config::get_u32bit("rng/fast_poll_request");
+ poll_type = "rng/fast_poll_request";
+
+ u32bit poll_for = global_config().option_as_u32bit(poll_type);
SecureVector<byte> buffer(poll_for ? poll_for : 256);