Chargement du reste de cette comparaison.

Untitled diff

Créé Le diff n'expire jamais
10 suppressions
930 lignes
9 ajouts
929 lignes
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2011-2012 The Peercoin developers
// Copyright (c) 2011-2012 The Peercoin developers
// Copyright (c) 2013-2014 The Peershares developers
// Copyright (c) 2013-2014 The Peershares developers
// Copyright (c) 2015-2015 The Decent developers
// Distributed under the MIT/X11 software license, see the accompanying
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
// file COPYING or http://www.opensource.org/licenses/mit-license.php.


#include "util.h"
#include "util.h"
#include "strlcpy.h"
#include "strlcpy.h"
#include "version.h"
#include "version.h"
#include "ui_interface.h"
#include "ui_interface.h"
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/join.hpp>


// Work around clang compilation problem in Boost 1.46:
// Work around clang compilation problem in Boost 1.46:
// /usr/include/boost/program_options/detail/config_file.hpp:163:17: error: call to function 'to_internal' that is neither visible in the template definition nor found by argument-dependent lookup
// /usr/include/boost/program_options/detail/config_file.hpp:163:17: error: call to function 'to_internal' that is neither visible in the template definition nor found by argument-dependent lookup
// See also: http://stackoverflow.com/questions/10020179/compilation-fail-in-boost-librairies-program-options
// See also: http://stackoverflow.com/questions/10020179/compilation-fail-in-boost-librairies-program-options
// http://clang.debian.net/status.php?version=3.0&key=CANNOT_FIND_FUNCTION
// http://clang.debian.net/status.php?version=3.0&key=CANNOT_FIND_FUNCTION
namespace boost {
namespace boost {
namespace program_options {
namespace program_options {
std::string to_internal(const std::string&);
std::string to_internal(const std::string&);
}
}
}
}


#include <boost/program_options/detail/config_file.hpp>
#include <boost/program_options/detail/config_file.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/interprocess/sync/interprocess_mutex.hpp>
#include <boost/interprocess/sync/interprocess_mutex.hpp>
#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
#include <boost/foreach.hpp>
#include <boost/foreach.hpp>
#include <boost/thread.hpp>
#include <boost/thread.hpp>
#include <openssl/crypto.h>
#include <openssl/crypto.h>
#include <openssl/rand.h>
#include <openssl/rand.h>


#ifdef WIN32
#ifdef WIN32
#ifdef _MSC_VER
#ifdef _MSC_VER
#pragma warning(disable:4786)
#pragma warning(disable:4786)
#pragma warning(disable:4804)
#pragma warning(disable:4804)
#pragma warning(disable:4805)
#pragma warning(disable:4805)
#pragma warning(disable:4717)
#pragma warning(disable:4717)
#endif
#endif
#ifdef _WIN32_WINNT
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#endif
#define _WIN32_WINNT 0x0501
#define _WIN32_WINNT 0x0501
#ifdef _WIN32_IE
#ifdef _WIN32_IE
#undef _WIN32_IE
#undef _WIN32_IE
#endif
#endif
#define _WIN32_IE 0x0501
#define _WIN32_IE 0x0501
#define WIN32_LEAN_AND_MEAN 1
#define WIN32_LEAN_AND_MEAN 1
#ifndef NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#define NOMINMAX
#endif
#endif
#include "shlobj.h"
#include "shlobj.h"
#include "shlwapi.h"
#include "shlwapi.h"
#endif
#endif


#ifndef WIN32
#ifndef WIN32
#include <execinfo.h>
#include <execinfo.h>
#endif
#endif


using namespace std;
using namespace std;
using namespace boost;
using namespace boost;


map<string, string> mapArgs;
map<string, string> mapArgs;
map<string, vector<string> > mapMultiArgs;
map<string, vector<string> > mapMultiArgs;
map<string, string> mapPeercoinArgs;
map<string, string> mapPeercoinArgs;
bool fDebug = false;
bool fDebug = false;
bool fPrintToConsole = false;
bool fPrintToConsole = false;
bool fPrintToDebugger = false;
bool fPrintToDebugger = false;
bool fRequestShutdown = false;
bool fRequestShutdown = false;
bool fShutdown = false;
bool fShutdown = false;
bool fDaemon = false;
bool fDaemon = false;
bool fServer = false;
bool fServer = false;
bool fCommandLine = false;
bool fCommandLine = false;
string strMiscWarning;
string strMiscWarning;
bool fTestNet = false;
bool fTestNet = false;
bool fNoListen = false;
bool fNoListen = false;
bool fLogTimestamps = false;
bool fLogTimestamps = false;
CMedianFilter<int64> vTimeOffsets(200,0);
CMedianFilter<int64> vTimeOffsets(200,0);


// Init openssl library multithreading support
// Init openssl library multithreading support
static boost::interprocess::interprocess_mutex** ppmutexOpenSSL;
static boost::interprocess::interprocess_mutex** ppmutexOpenSSL;
void locking_callback(int mode, int i, const char* file, int line)
void locking_callback(int mode, int i, const char* file, int line)
{
{
if (mode & CRYPTO_LOCK)
if (mode & CRYPTO_LOCK)
ppmutexOpenSSL[i]->lock();
ppmutexOpenSSL[i]->lock();
else
else
ppmutexOpenSSL[i]->unlock();
ppmutexOpenSSL[i]->unlock();
}
}


// Init
// Init
class CInit
class CInit
{
{
public:
public:
CInit()
CInit()
{
{
// Init openssl library multithreading support
// Init openssl library multithreading support
ppmutexOpenSSL = (boost::interprocess::interprocess_mutex**)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(boost::interprocess::interprocess_mutex*));
ppmutexOpenSSL = (boost::interprocess::interprocess_mutex**)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(boost::interprocess::interprocess_mutex*));