aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-07-14 14:33:10 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-07-14 14:54:07 -0700
commitb7d6623c76e1468f2a93db5a3120580e2784d74a (patch)
treeb29cbe8e06575d6e41bb645bf80070f904c3c001
parent66270a416edb1610f276124483feceef9cba93ff (diff)
parent4652791141f0a8a977b324147ccf1a2360b69ca4 (diff)
Merge #10819: Fix uninitialized atomic variables
465279114 Fix uninitialized atomic variables (João Barbosa) Tree-SHA512: 5dd8924bc8743a094abdbc2464b835a0e7fd4948c102ea7c2251c6330bea5615c4459ba322a656fd6ac5f8d695b69d3709d225ddccef226cf8afc7de5e3d3019
-rw-r--r--src/netbase.cpp2
-rw-r--r--src/wallet/db.h4
-rw-r--r--src/wallet/walletdb.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp
index a23f92e1ed..3fb1c18f03 100644
--- a/src/netbase.cpp
+++ b/src/netbase.cpp
@@ -563,7 +563,7 @@ static bool ConnectThroughProxy(const proxyType &proxy, const std::string& strDe
// do socks negotiation
if (proxy.randomize_credentials) {
ProxyCredentials random_auth;
- static std::atomic_int counter;
+ static std::atomic_int counter(0);
random_auth.username = random_auth.password = strprintf("%i", counter++);
if (!Socks5(strDest, (unsigned short)port, &random_auth, hSocket))
return false;
diff --git a/src/wallet/db.h b/src/wallet/db.h
index 7cccc65660..4f3ad0c42d 100644
--- a/src/wallet/db.h
+++ b/src/wallet/db.h
@@ -95,13 +95,13 @@ class CWalletDBWrapper
friend class CDB;
public:
/** Create dummy DB handle */
- CWalletDBWrapper() : nLastSeen(0), nLastFlushed(0), nLastWalletUpdate(0), env(nullptr)
+ CWalletDBWrapper() : nUpdateCounter(0), nLastSeen(0), nLastFlushed(0), nLastWalletUpdate(0), env(nullptr)
{
}
/** Create DB handle to real database */
CWalletDBWrapper(CDBEnv *env_in, const std::string &strFile_in) :
- nLastSeen(0), nLastFlushed(0), nLastWalletUpdate(0), env(env_in), strFile(strFile_in)
+ nUpdateCounter(0), nLastSeen(0), nLastFlushed(0), nLastWalletUpdate(0), env(env_in), strFile(strFile_in)
{
}
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp
index deb09a4771..2a33dca240 100644
--- a/src/wallet/walletdb.cpp
+++ b/src/wallet/walletdb.cpp
@@ -747,7 +747,7 @@ DBErrors CWalletDB::ZapWalletTx(std::vector<CWalletTx>& vWtx)
void MaybeCompactWalletDB()
{
- static std::atomic<bool> fOneThread;
+ static std::atomic<bool> fOneThread(false);
if (fOneThread.exchange(true)) {
return;
}