aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/util.cpp6
-rw-r--r--common/util.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/common/util.cpp b/common/util.cpp
index 5c85e74c70..cdb9bf9c60 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -75,8 +75,10 @@ void hexdump(const byte * data, int len, int bytesPerLine) {
printf("|\n");
}
-RandomSource::RandomSource(uint32 seed) {
- _randSeed = seed;
+RandomSource::RandomSource() {
+ // Use system time as RNG seed. Normally not a good idea, if you are using
+ // a RNG for security purposes, but good enough for our purposes.
+ setSeed(time(0));
}
void RandomSource::setSeed(uint32 seed) {
diff --git a/common/util.h b/common/util.h
index a62511d6da..760ad25a08 100644
--- a/common/util.h
+++ b/common/util.h
@@ -55,7 +55,7 @@ private:
uint32 _randSeed;
public:
- RandomSource(uint32 seed = 0xA943DE33);
+ RandomSource();
void setSeed(uint32 seed);
/**