diff options
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/keystore.cpp | 1 | ||||
-rw-r--r-- | src/util.cpp | 18 | ||||
-rw-r--r-- | src/wallet/crypter.cpp (renamed from src/crypter.cpp) | 0 | ||||
-rw-r--r-- | src/wallet/crypter.h (renamed from src/crypter.h) | 0 | ||||
-rw-r--r-- | src/wallet/wallet.h | 2 |
6 files changed, 12 insertions, 13 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index d1a8efaa6a..2c607c632e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -88,7 +88,6 @@ BITCOIN_CORE_H = \ compat.h \ compressor.h \ core_io.h \ - crypter.h \ wallet/db.h \ eccryptoverify.h \ ecwrapper.h \ @@ -140,6 +139,7 @@ BITCOIN_CORE_H = \ utilstrencodings.h \ utiltime.h \ version.h \ + wallet/crypter.h \ wallet/walletdb.h \ wallet/wallet.h \ wallet/wallet_ismine.h \ @@ -198,8 +198,8 @@ libbitcoin_server_a_SOURCES = \ # when wallet enabled libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_wallet_a_SOURCES = \ + wallet/crypter.cpp \ wallet/db.cpp \ - crypter.cpp \ wallet/rpcdump.cpp \ wallet/rpcwallet.cpp \ wallet/wallet.cpp \ diff --git a/src/keystore.cpp b/src/keystore.cpp index 7531737e04..3bae24b7b9 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -5,7 +5,6 @@ #include "keystore.h" -#include "crypter.h" #include "key.h" #include "util.h" diff --git a/src/util.cpp b/src/util.cpp index 792f00b61d..4192e44ae1 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -723,18 +723,18 @@ void RenameThread(const char* name) void SetupEnvironment() { -#ifndef WIN32 - try - { -#if BOOST_FILESYSTEM_VERSION == 3 - boost::filesystem::path::codecvt(); // Raises runtime error if current locale is invalid -#else // boost filesystem v2 - std::locale(); // Raises runtime error if current locale is invalid -#endif + // On most POSIX systems (e.g. Linux, but not BSD) the environment's locale + // may be invalid, in which case the "C" locale is used as fallback. +#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__) + try { + std::locale(""); // Raises a runtime error if current locale is invalid } catch (const std::runtime_error&) { - setenv("LC_ALL", "C", 1); // Force C locale + std::locale::global(std::locale("C")); } #endif + // The path locale is lazy initialized and to avoid deinitialization errors + // in multithreading environments, it is set explicitly by the main thread. + boost::filesystem::path::imbue(std::locale()); } void SetThreadPriority(int nPriority) diff --git a/src/crypter.cpp b/src/wallet/crypter.cpp index c7f7e21679..c7f7e21679 100644 --- a/src/crypter.cpp +++ b/src/wallet/crypter.cpp diff --git a/src/crypter.h b/src/wallet/crypter.h index 32746b00df..32746b00df 100644 --- a/src/crypter.h +++ b/src/wallet/crypter.h diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index f00fb0caff..3f5f2859b6 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -9,11 +9,11 @@ #include "amount.h" #include "primitives/block.h" #include "primitives/transaction.h" -#include "crypter.h" #include "key.h" #include "keystore.h" #include "main.h" #include "ui_interface.h" +#include "wallet/crypter.h" #include "wallet/wallet_ismine.h" #include "wallet/walletdb.h" |