Permalink
Browse files
Fix uninitialized atomic variables
- Loading branch information...
Showing
with
4 additions
and
4 deletions.
-
+1
−1
src/netbase.cpp
-
+2
−2
src/wallet/db.h
-
+1
−1
src/wallet/walletdb.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;
|
|
|
|
|
|
@@ -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)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -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;
|
|
|
}
|
|
|
|
0 comments on commit
4652791