aboutsummaryrefslogtreecommitdiff
path: root/src/coins.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-06-07 16:29:03 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2016-06-07 16:29:03 +0200
commit888483098e60f2a944f1d246bbfec4d14a2975f8 (patch)
tree3c1ebad509c274f0bdedbc9193aef45aefb1e104 /src/coins.cpp
parentc31b24f745a84669f2af729052da7fd7ed2da868 (diff)
Use C++11 thread-safe static initializers
Diffstat (limited to 'src/coins.cpp')
-rw-r--r--src/coins.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/coins.cpp b/src/coins.cpp
index b7dd293d69..39db7dedfb 100644
--- a/src/coins.cpp
+++ b/src/coins.cpp
@@ -56,11 +56,7 @@ void CCoinsViewBacked::SetBackend(CCoinsView &viewIn) { base = &viewIn; }
bool CCoinsViewBacked::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return base->BatchWrite(mapCoins, hashBlock); }
CCoinsViewCursor *CCoinsViewBacked::Cursor() const { return base->Cursor(); }
-SaltedTxidHasher::SaltedTxidHasher()
-{
- GetRandBytes((unsigned char*)&k0, sizeof(k0));
- GetRandBytes((unsigned char*)&k1, sizeof(k1));
-}
+SaltedTxidHasher::SaltedTxidHasher() : k0(GetRand(std::numeric_limits<uint64_t>::max())), k1(GetRand(std::numeric_limits<uint64_t>::max())) {}
CCoinsViewCache::CCoinsViewCache(CCoinsView *baseIn) : CCoinsViewBacked(baseIn), hasModifier(false), cachedCoinsUsage(0) { }