mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Merge branch 'master' of github.com:jedmccaleb/NewCoin
This commit is contained in:
@@ -7,9 +7,10 @@ import platform
|
|||||||
|
|
||||||
OSX = bool(platform.mac_ver()[0])
|
OSX = bool(platform.mac_ver()[0])
|
||||||
FreeBSD = bool('FreeBSD' == platform.system())
|
FreeBSD = bool('FreeBSD' == platform.system())
|
||||||
Ubuntu = bool('Ubuntu' == platform.dist())
|
Linux = bool('Linux' == platform.system())
|
||||||
|
Ubuntu = bool(Linux and 'Ubuntu' == platform.linux_distribution()[0])
|
||||||
|
|
||||||
if OSX:
|
if OSX or Ubuntu:
|
||||||
CTAGS = '/usr/bin/ctags'
|
CTAGS = '/usr/bin/ctags'
|
||||||
else:
|
else:
|
||||||
CTAGS = '/usr/bin/exuberant-ctags'
|
CTAGS = '/usr/bin/exuberant-ctags'
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ void SqliteDatabase::connect()
|
|||||||
int rc = sqlite3_open(mHost.c_str(), &mConnection);
|
int rc = sqlite3_open(mHost.c_str(), &mConnection);
|
||||||
if (rc)
|
if (rc)
|
||||||
{
|
{
|
||||||
cLog(lsFATAL) << "Can't open database: " << mHost << " " << rc;
|
cLog(lsFATAL) << "Can't open " << mHost << " " << rc;
|
||||||
sqlite3_close(mConnection);
|
sqlite3_close(mConnection);
|
||||||
assert((rc != SQLITE_BUSY) && (rc != SQLITE_LOCKED));
|
assert((rc != SQLITE_BUSY) && (rc != SQLITE_LOCKED));
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ bool SqliteDatabase::executeSQL(const char* sql, bool fail_ok)
|
|||||||
if (!fail_ok)
|
if (!fail_ok)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cLog(lsWARNING) << "SQL Perror:" << rc;
|
cLog(lsWARNING) << "Perror:" << mHost << ": " << rc;
|
||||||
cLog(lsWARNING) << "Statement: " << sql;
|
cLog(lsWARNING) << "Statement: " << sql;
|
||||||
cLog(lsWARNING) << "Error: " << sqlite3_errmsg(mConnection);
|
cLog(lsWARNING) << "Error: " << sqlite3_errmsg(mConnection);
|
||||||
#endif
|
#endif
|
||||||
@@ -69,13 +69,17 @@ bool SqliteDatabase::executeSQL(const char* sql, bool fail_ok)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assert((rc != SQLITE_BUSY) && (rc != SQLITE_LOCKED));
|
if ((rc != SQLITE_BUSY) && (rc != SQLITE_LOCKED))
|
||||||
|
{
|
||||||
|
cLog(lsFATAL) << mHost << " returns error " << rc << ": " << sqlite3_errmsg(mConnection);
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
mMoreRows = false;
|
mMoreRows = false;
|
||||||
|
|
||||||
if (!fail_ok)
|
if (!fail_ok)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cLog(lsWARNING) << "SQL Serror:" << rc;
|
cLog(lsWARNING) << "SQL Serror:" << mHost << ": " << rc;
|
||||||
cLog(lsWARNING) << "Statement: " << sql;
|
cLog(lsWARNING) << "Statement: " << sql;
|
||||||
cLog(lsWARNING) << "Error: " << sqlite3_errmsg(mConnection);
|
cLog(lsWARNING) << "Error: " << sqlite3_errmsg(mConnection);
|
||||||
#endif
|
#endif
|
||||||
@@ -135,7 +139,7 @@ bool SqliteDatabase::getNextRow()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
assert((rc != SQLITE_BUSY) && (rc != SQLITE_LOCKED));
|
assert((rc != SQLITE_BUSY) && (rc != SQLITE_LOCKED));
|
||||||
cLog(lsWARNING) << "SQL Rerror:" << rc;
|
cLog(lsWARNING) << "Rerror: " << mHost << ": " << rc;
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -244,8 +248,8 @@ void SqliteDatabase::runWal()
|
|||||||
int ret = sqlite3_wal_checkpoint_v2(mConnection, db.c_str(), SQLITE_CHECKPOINT_PASSIVE, &log, &ckpt);
|
int ret = sqlite3_wal_checkpoint_v2(mConnection, db.c_str(), SQLITE_CHECKPOINT_PASSIVE, &log, &ckpt);
|
||||||
if (ret != SQLITE_OK)
|
if (ret != SQLITE_OK)
|
||||||
{
|
{
|
||||||
cLog((ret == SQLITE_LOCKED) ? lsDEBUG : lsWARNING) << "WAL "
|
cLog((ret == SQLITE_LOCKED) ? lsDEBUG : lsWARNING) << "WAL " << mHost << ":"
|
||||||
<< sqlite3_db_filename(mConnection, "main") << " / " << db << " errror " << ret;
|
<< db << " errror " << ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
walSet.clear();
|
walSet.clear();
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ void Application::setup()
|
|||||||
//
|
//
|
||||||
// Allow peer connections.
|
// Allow peer connections.
|
||||||
//
|
//
|
||||||
if (!theConfig.RUN_STANDALONE && !theConfig.PEER_IP.empty() && theConfig.PEER_PORT)
|
if (!theConfig.RUN_STANDALONE)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -694,7 +694,7 @@ int commandLineRPC(const std::vector<std::string>& vCmd)
|
|||||||
return nRet;
|
return nRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RPC_NOTIFY_MAX_BYTES 8192
|
#define RPC_REPLY_MAX_BYTES (128*1024*1024)
|
||||||
#define RPC_NOTIFY_SECONDS 10
|
#define RPC_NOTIFY_SECONDS 10
|
||||||
|
|
||||||
bool responseRPC(
|
bool responseRPC(
|
||||||
@@ -787,7 +787,7 @@ void callRPC(
|
|||||||
jvParams,
|
jvParams,
|
||||||
mapRequestHeaders,
|
mapRequestHeaders,
|
||||||
"/", _1, _2),
|
"/", _1, _2),
|
||||||
RPC_NOTIFY_MAX_BYTES,
|
RPC_REPLY_MAX_BYTES,
|
||||||
boost::posix_time::seconds(RPC_NOTIFY_SECONDS),
|
boost::posix_time::seconds(RPC_NOTIFY_SECONDS),
|
||||||
boost::bind(&responseRPC, callbackFuncP, _1, _2, _3));
|
boost::bind(&responseRPC, callbackFuncP, _1, _2, _3));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,12 @@ PeerDoor::PeerDoor(boost::asio::io_service& io_service) :
|
|||||||
if (1 != SSL_CTX_set_cipher_list(mCtx.native_handle(), theConfig.PEER_SSL_CIPHER_LIST.c_str()))
|
if (1 != SSL_CTX_set_cipher_list(mCtx.native_handle(), theConfig.PEER_SSL_CIPHER_LIST.c_str()))
|
||||||
std::runtime_error("Error setting cipher list (no valid ciphers).");
|
std::runtime_error("Error setting cipher list (no valid ciphers).");
|
||||||
|
|
||||||
Log(lsINFO) << "Peer port: " << theConfig.PEER_IP << " " << theConfig.PEER_PORT;
|
|
||||||
|
|
||||||
startListening();
|
if (!theConfig.PEER_IP.empty() && theConfig.PEER_PORT)
|
||||||
|
{
|
||||||
|
Log(lsINFO) << "Peer port: " << theConfig.PEER_IP << " " << theConfig.PEER_PORT;
|
||||||
|
startListening();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerDoor::startListening()
|
void PeerDoor::startListening()
|
||||||
|
|||||||
Reference in New Issue
Block a user