yep
This commit is contained in:
@@ -72,14 +72,21 @@ void WaitForShutdown(boost::thread_group* threadGroup)
|
|||||||
{
|
{
|
||||||
int32_t i,height; CBlockIndex *pindex; bool fShutdown = ShutdownRequested(); const uint256 zeroid;
|
int32_t i,height; CBlockIndex *pindex; bool fShutdown = ShutdownRequested(); const uint256 zeroid;
|
||||||
fprintf(stderr,"%s: fShutdown=%d, KOMODO_EARLYTXID_HEIGHT=%d\n", __FUNCTION__, fShutdown, KOMODO_EARLYTXID_HEIGHT);
|
fprintf(stderr,"%s: fShutdown=%d, KOMODO_EARLYTXID_HEIGHT=%d\n", __FUNCTION__, fShutdown, KOMODO_EARLYTXID_HEIGHT);
|
||||||
|
fprintf(stderr,"%s: earlytxid=%s, tx_height=%d\n", __FUNCTION__, KOMODO_EARLYTXID.GetHex(), tx_height(KOMODO_EARLYTXID) );
|
||||||
|
|
||||||
|
height=tx_height(KOMODO_EARLYTXID);
|
||||||
// Tell the main threads to shutdown.
|
// Tell the main threads to shutdown.
|
||||||
|
StartShutdown();
|
||||||
|
/*
|
||||||
if (komodo_currentheight()>KOMODO_EARLYTXID_HEIGHT && KOMODO_EARLYTXID!=zeroid && ((height=tx_height(KOMODO_EARLYTXID))==0 || height>KOMODO_EARLYTXID_HEIGHT))
|
if (komodo_currentheight()>KOMODO_EARLYTXID_HEIGHT && KOMODO_EARLYTXID!=zeroid && ((height=tx_height(KOMODO_EARLYTXID))==0 || height>KOMODO_EARLYTXID_HEIGHT))
|
||||||
{
|
{
|
||||||
fprintf(stderr,"error: earlytx must be before block height %d or tx does not exist\n",KOMODO_EARLYTXID_HEIGHT);
|
fprintf(stderr,"error: earlytx must be before block height %d or tx does not exist\n",KOMODO_EARLYTXID_HEIGHT);
|
||||||
StartShutdown();
|
StartShutdown();
|
||||||
}
|
} else {
|
||||||
|
fprintf(stderr,"%s: Not true\n", __FUNCTION__);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
fprintf(stderr,"%s: komodo_currentheight=%d\n", __FUNCTION__, komodo_currentheight() );
|
||||||
fprintf(stderr,"%s: earlytx height=%d, ASSETCHAINS_CBOPRET=%li\n", __FUNCTION__, height, ASSETCHAINS_CBOPRET);
|
fprintf(stderr,"%s: earlytx height=%d, ASSETCHAINS_CBOPRET=%li\n", __FUNCTION__, height, ASSETCHAINS_CBOPRET);
|
||||||
|
|
||||||
/*if ( ASSETCHAINS_STAKED == 0 && ASSETCHAINS_ADAPTIVEPOW == 0 && (pindex= komodo_chainactive(1)) != 0 )
|
/*if ( ASSETCHAINS_STAKED == 0 && ASSETCHAINS_ADAPTIVEPOW == 0 && (pindex= komodo_chainactive(1)) != 0 )
|
||||||
|
|||||||
73
src/init.cpp
73
src/init.cpp
@@ -207,6 +207,7 @@ void Interrupt(boost::thread_group& threadGroup)
|
|||||||
|
|
||||||
void Shutdown()
|
void Shutdown()
|
||||||
{
|
{
|
||||||
|
fprintf(stderr,"%s: start\n", __FUNCTION__);
|
||||||
LogPrintf("%s: In progress...\n", __func__);
|
LogPrintf("%s: In progress...\n", __func__);
|
||||||
static CCriticalSection cs_Shutdown;
|
static CCriticalSection cs_Shutdown;
|
||||||
TRY_LOCK(cs_Shutdown, lockShutdown);
|
TRY_LOCK(cs_Shutdown, lockShutdown);
|
||||||
@@ -218,10 +219,11 @@ void Shutdown()
|
|||||||
/// Be sure that anything that writes files or flushes caches only does this if the respective
|
/// Be sure that anything that writes files or flushes caches only does this if the respective
|
||||||
/// module was initialized.
|
/// module was initialized.
|
||||||
static char shutoffstr[128];
|
static char shutoffstr[128];
|
||||||
sprintf(shutoffstr,"%s-shutoff",ASSETCHAINS_SYMBOL);
|
sprintf(shutoffstr,"%s-shutoff","hush");
|
||||||
RenameThread(shutoffstr);
|
RenameThread(shutoffstr);
|
||||||
mempool.AddTransactionsUpdated(1);
|
mempool.AddTransactionsUpdated(1);
|
||||||
|
|
||||||
|
fprintf(stderr,"%s: stopping HTTP/REST/RPC\n", __FUNCTION__);
|
||||||
StopHTTPRPC();
|
StopHTTPRPC();
|
||||||
StopREST();
|
StopREST();
|
||||||
StopRPC();
|
StopRPC();
|
||||||
@@ -237,6 +239,7 @@ void Shutdown()
|
|||||||
GenerateBitcoins(false, 0);
|
GenerateBitcoins(false, 0);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
fprintf(stderr,"%s: stopping node\n", __FUNCTION__);
|
||||||
StopNode();
|
StopNode();
|
||||||
StopTorControl();
|
StopTorControl();
|
||||||
UnregisterNodeSignals(GetNodeSignals());
|
UnregisterNodeSignals(GetNodeSignals());
|
||||||
@@ -747,17 +750,20 @@ void ThreadNotifyRecentlyAdded()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sanity checks
|
/** Sanity checks
|
||||||
* Ensure that Bitcoin is running in a usable environment with all
|
* Ensure that Hush is running in a usable environment with all
|
||||||
* necessary library support.
|
* necessary library support.
|
||||||
*/
|
*/
|
||||||
bool InitSanityCheck(void)
|
bool InitSanityCheck(void)
|
||||||
{
|
{
|
||||||
if(!ECC_InitSanityCheck()) {
|
if(!ECC_InitSanityCheck()) {
|
||||||
InitError("Elliptic curve cryptography sanity check failure. Aborting.");
|
InitError("Elliptic curve cryptography sanity check failure. Aborting.");
|
||||||
|
fprintf(stderr,"%s: ECC insanity!\n", __FUNCTION__);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!glibc_sanity_test() || !glibcxx_sanity_test())
|
if (!glibc_sanity_test() || !glibcxx_sanity_test()) {
|
||||||
|
fprintf(stderr,"%s: glibc insanity!\n", __FUNCTION__);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -894,6 +900,7 @@ extern int32_t KOMODO_REWIND;
|
|||||||
|
|
||||||
bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||||
{
|
{
|
||||||
|
fprintf(stderr,"%s start\n", __FUNCTION__);
|
||||||
// ********************************************************* Step 1: setup
|
// ********************************************************* Step 1: setup
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
// Turn off Microsoft heap dump noise
|
// Turn off Microsoft heap dump noise
|
||||||
@@ -920,6 +927,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
|
|
||||||
if (!SetupNetworking())
|
if (!SetupNetworking())
|
||||||
return InitError("Error: Initializing networking failed");
|
return InitError("Error: Initializing networking failed");
|
||||||
|
fprintf(stderr,"%s networking setup\n", __FUNCTION__);
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
if (GetBoolArg("-sysperms", false)) {
|
if (GetBoolArg("-sysperms", false)) {
|
||||||
@@ -928,9 +936,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
return InitError("Error: -sysperms is not allowed in combination with enabled wallet functionality");
|
return InitError("Error: -sysperms is not allowed in combination with enabled wallet functionality");
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
fprintf(stderr,"%s setting umask\n", __FUNCTION__);
|
||||||
umask(077);
|
umask(077);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik1\n", __FUNCTION__);
|
||||||
// Clean shutdown on SIGTERM
|
// Clean shutdown on SIGTERM
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
sa.sa_handler = HandleSIGTERM;
|
sa.sa_handler = HandleSIGTERM;
|
||||||
@@ -952,31 +962,42 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
|
|
||||||
std::set_new_handler(new_handler_terminate);
|
std::set_new_handler(new_handler_terminate);
|
||||||
|
|
||||||
|
fprintf(stderr,"%s: set signal handlers\n", __FUNCTION__);
|
||||||
|
|
||||||
// ********************************************************* Step 2: parameter interactions
|
// ********************************************************* Step 2: parameter interactions
|
||||||
const CChainParams& chainparams = Params();
|
const CChainParams& chainparams = Params();
|
||||||
|
|
||||||
|
fprintf(stderr,"%s: got chain params\n", __FUNCTION__);
|
||||||
|
|
||||||
// Set this early so that experimental features are correctly enabled/disabled
|
// Set this early so that experimental features are correctly enabled/disabled
|
||||||
fExperimentalMode = GetBoolArg("-experimentalfeatures", true);
|
fExperimentalMode = GetBoolArg("-experimentalfeatures", true);
|
||||||
|
|
||||||
|
fprintf(stderr,"%s: fExperimentalMode=%d\n", __FUNCTION__, fExperimentalMode);
|
||||||
|
|
||||||
// Fail early if user has set experimental options without the global flag
|
// Fail early if user has set experimental options without the global flag
|
||||||
if (!fExperimentalMode) {
|
if (!fExperimentalMode) {
|
||||||
if (mapArgs.count("-developerencryptwallet")) {
|
if (mapArgs.count("-developerencryptwallet")) {
|
||||||
|
fprintf(stderr,"%s wallet encryption error\n", __FUNCTION__);
|
||||||
return InitError(_("Wallet encryption requires -experimentalfeatures."));
|
return InitError(_("Wallet encryption requires -experimentalfeatures."));
|
||||||
}
|
}
|
||||||
else if (mapArgs.count("-paymentdisclosure")) {
|
else if (mapArgs.count("-paymentdisclosure")) {
|
||||||
|
fprintf(stderr,"%s payment disclosure error\n", __FUNCTION__);
|
||||||
return InitError(_("Payment disclosure requires -experimentalfeatures."));
|
return InitError(_("Payment disclosure requires -experimentalfeatures."));
|
||||||
} else if (mapArgs.count("-zmergetoaddress")) {
|
} else if (mapArgs.count("-zmergetoaddress")) {
|
||||||
|
fprintf(stderr,"%s zmerge error\n", __FUNCTION__);
|
||||||
return InitError(_("RPC method z_mergetoaddress requires -experimentalfeatures."));
|
return InitError(_("RPC method z_mergetoaddress requires -experimentalfeatures."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fprintf(stderr,"%s tik2\n", __FUNCTION__);
|
||||||
|
|
||||||
// Set this early so that parameter interactions go to console
|
// Set this early so that parameter interactions go to console
|
||||||
fPrintToConsole = GetBoolArg("-printtoconsole", false);
|
fPrintToConsole = GetBoolArg("-printtoconsole", false);
|
||||||
fLogTimestamps = GetBoolArg("-logtimestamps", true);
|
fLogTimestamps = GetBoolArg("-logtimestamps", true);
|
||||||
fLogIPs = GetBoolArg("-logips", false);
|
fLogIPs = GetBoolArg("-logips", false);
|
||||||
|
|
||||||
|
|
||||||
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
||||||
LogPrintf("Zcash version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
|
LogPrintf("Hush version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
|
||||||
|
|
||||||
// when specifying an explicit binding address, you want to listen on it
|
// when specifying an explicit binding address, you want to listen on it
|
||||||
// even when -connect or -proxy is specified
|
// even when -connect or -proxy is specified
|
||||||
@@ -989,6 +1010,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
LogPrintf("%s: parameter interaction: -whitebind set -> setting -listen=1\n", __func__);
|
LogPrintf("%s: parameter interaction: -whitebind set -> setting -listen=1\n", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik3\n", __FUNCTION__);
|
||||||
if (mapArgs.count("-connect") && mapMultiArgs["-connect"].size() > 0) {
|
if (mapArgs.count("-connect") && mapMultiArgs["-connect"].size() > 0) {
|
||||||
// when only connecting to trusted nodes, do not seed via DNS, or listen by default
|
// when only connecting to trusted nodes, do not seed via DNS, or listen by default
|
||||||
if (SoftSetBoolArg("-dnsseed", false))
|
if (SoftSetBoolArg("-dnsseed", false))
|
||||||
@@ -1031,6 +1053,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
if (SoftSetBoolArg("-rescan", true))
|
if (SoftSetBoolArg("-rescan", true))
|
||||||
LogPrintf("%s: parameter interaction: -zapwallettxes=<mode> -> setting -rescan=1\n", __func__);
|
LogPrintf("%s: parameter interaction: -zapwallettxes=<mode> -> setting -rescan=1\n", __func__);
|
||||||
}
|
}
|
||||||
|
fprintf(stderr,"%s tik4\n", __FUNCTION__);
|
||||||
|
|
||||||
// Make sure enough file descriptors are available
|
// Make sure enough file descriptors are available
|
||||||
int nBind = std::max((int)mapArgs.count("-bind") + (int)mapArgs.count("-whitebind"), 1);
|
int nBind = std::max((int)mapArgs.count("-bind") + (int)mapArgs.count("-whitebind"), 1);
|
||||||
@@ -1038,7 +1061,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
//fprintf(stderr,"nMaxConnections %d\n",nMaxConnections);
|
//fprintf(stderr,"nMaxConnections %d\n",nMaxConnections);
|
||||||
nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0);
|
nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0);
|
||||||
int nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS);
|
int nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS);
|
||||||
//fprintf(stderr,"nMaxConnections %d FD_SETSIZE.%d nBind.%d expr.%d \n",nMaxConnections,FD_SETSIZE,nBind,(int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS));
|
fprintf(stderr,"nMaxConnections %d FD_SETSIZE.%d nBind.%d expr.%d \n",nMaxConnections,FD_SETSIZE,nBind,(int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS));
|
||||||
if (nFD < MIN_CORE_FILEDESCRIPTORS)
|
if (nFD < MIN_CORE_FILEDESCRIPTORS)
|
||||||
return InitError(_("Not enough file descriptors available."));
|
return InitError(_("Not enough file descriptors available."));
|
||||||
if (nFD - MIN_CORE_FILEDESCRIPTORS < nMaxConnections)
|
if (nFD - MIN_CORE_FILEDESCRIPTORS < nMaxConnections)
|
||||||
@@ -1076,6 +1099,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik5\n", __FUNCTION__);
|
||||||
// Check for -debugnet
|
// Check for -debugnet
|
||||||
if (GetBoolArg("-debugnet", false))
|
if (GetBoolArg("-debugnet", false))
|
||||||
InitWarning(_("Warning: Unsupported argument -debugnet ignored, use -debug=net."));
|
InitWarning(_("Warning: Unsupported argument -debugnet ignored, use -debug=net."));
|
||||||
@@ -1107,6 +1131,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS;
|
nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS;
|
||||||
|
|
||||||
fServer = GetBoolArg("-server", false);
|
fServer = GetBoolArg("-server", false);
|
||||||
|
fprintf(stderr,"%s tik6\n", __FUNCTION__);
|
||||||
|
|
||||||
// block pruning; get the amount of disk space (in MB) to allot for block & undo files
|
// block pruning; get the amount of disk space (in MB) to allot for block & undo files
|
||||||
int64_t nSignedPruneTarget = GetArg("-prune", 0) * 1024 * 1024;
|
int64_t nSignedPruneTarget = GetArg("-prune", 0) * 1024 * 1024;
|
||||||
@@ -1194,6 +1219,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
expiryDelta = GetArg("-txexpirydelta", DEFAULT_TX_EXPIRY_DELTA);
|
expiryDelta = GetArg("-txexpirydelta", DEFAULT_TX_EXPIRY_DELTA);
|
||||||
bSpendZeroConfChange = GetBoolArg("-spendzeroconfchange", true);
|
bSpendZeroConfChange = GetBoolArg("-spendzeroconfchange", true);
|
||||||
fSendFreeTransactions = GetBoolArg("-sendfreetransactions", false);
|
fSendFreeTransactions = GetBoolArg("-sendfreetransactions", false);
|
||||||
|
fprintf(stderr,"%s tik7\n", __FUNCTION__);
|
||||||
|
|
||||||
std::string strWalletFile = GetArg("-wallet", "wallet.dat");
|
std::string strWalletFile = GetArg("-wallet", "wallet.dat");
|
||||||
#endif // ENABLE_WALLET
|
#endif // ENABLE_WALLET
|
||||||
@@ -1212,6 +1238,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
nLocalServices |= NODE_BLOOM;
|
nLocalServices |= NODE_BLOOM;
|
||||||
}
|
}
|
||||||
nMaxTipAge = GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE);
|
nMaxTipAge = GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE);
|
||||||
|
fprintf(stderr,"%s tik8\n", __FUNCTION__);
|
||||||
|
|
||||||
#ifdef ENABLE_MINING
|
#ifdef ENABLE_MINING
|
||||||
if (mapArgs.count("-mineraddress")) {
|
if (mapArgs.count("-mineraddress")) {
|
||||||
@@ -1234,6 +1261,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik9\n", __FUNCTION__);
|
||||||
if (!mapMultiArgs["-nuparams"].empty()) {
|
if (!mapMultiArgs["-nuparams"].empty()) {
|
||||||
// Allow overriding network upgrade parameters for testing
|
// Allow overriding network upgrade parameters for testing
|
||||||
if (Params().NetworkIDString() != "regtest") {
|
if (Params().NetworkIDString() != "regtest") {
|
||||||
@@ -1271,6 +1299,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
|
|
||||||
// Initialize libsodium
|
// Initialize libsodium
|
||||||
if (init_and_check_sodium() == -1) {
|
if (init_and_check_sodium() == -1) {
|
||||||
|
fprintf(stderr,"%s: libsodium init failed!\n", __FUNCTION__);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1278,6 +1307,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
ECC_Start();
|
ECC_Start();
|
||||||
globalVerifyHandle.reset(new ECCVerifyHandle());
|
globalVerifyHandle.reset(new ECCVerifyHandle());
|
||||||
|
|
||||||
|
/*
|
||||||
// set the hash algorithm to use for this chain
|
// set the hash algorithm to use for this chain
|
||||||
// Again likely better solution here, than using long IF ELSE.
|
// Again likely better solution here, than using long IF ELSE.
|
||||||
extern uint32_t ASSETCHAINS_ALGO, ASSETCHAINS_VERUSHASH, ASSETCHAINS_VERUSHASHV1_1;
|
extern uint32_t ASSETCHAINS_ALGO, ASSETCHAINS_VERUSHASH, ASSETCHAINS_VERUSHASHV1_1;
|
||||||
@@ -1293,7 +1323,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
// initialize VerusHashV2
|
// initialize VerusHashV2
|
||||||
CBlockHeader::SetVerusHashV2();
|
CBlockHeader::SetVerusHashV2();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik10\n", __FUNCTION__);
|
||||||
// Sanity check
|
// Sanity check
|
||||||
if (!InitSanityCheck())
|
if (!InitSanityCheck())
|
||||||
return InitError(_("Initialization sanity check failed. Please check for insanity. Hush is shutting down!"));
|
return InitError(_("Initialization sanity check failed. Please check for insanity. Hush is shutting down!"));
|
||||||
@@ -1310,6 +1342,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
if (file) fclose(file);
|
if (file) fclose(file);
|
||||||
|
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik11\n", __FUNCTION__);
|
||||||
fprintf(stderr,"Attempting to obtain lock %s\n", pathLockFile.string().c_str());
|
fprintf(stderr,"Attempting to obtain lock %s\n", pathLockFile.string().c_str());
|
||||||
try {
|
try {
|
||||||
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
|
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
|
||||||
@@ -1324,6 +1357,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
#endif
|
#endif
|
||||||
if (GetBoolArg("-shrinkdebugfile", !fDebug))
|
if (GetBoolArg("-shrinkdebugfile", !fDebug))
|
||||||
ShrinkDebugFile();
|
ShrinkDebugFile();
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik12\n", __FUNCTION__);
|
||||||
|
|
||||||
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
|
||||||
LogPrintf("Hush version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
|
LogPrintf("Hush version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
|
||||||
|
|
||||||
@@ -1347,12 +1383,15 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
threadGroup.create_thread(&ThreadScriptCheck);
|
threadGroup.create_thread(&ThreadScriptCheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik13\n", __FUNCTION__);
|
||||||
|
|
||||||
// Start the lightweight task scheduler thread
|
// Start the lightweight task scheduler thread
|
||||||
CScheduler::Function serviceLoop = boost::bind(&CScheduler::serviceQueue, &scheduler);
|
CScheduler::Function serviceLoop = boost::bind(&CScheduler::serviceQueue, &scheduler);
|
||||||
threadGroup.create_thread(boost::bind(&TraceThread<CScheduler::Function>, "scheduler", serviceLoop));
|
threadGroup.create_thread(boost::bind(&TraceThread<CScheduler::Function>, "scheduler", serviceLoop));
|
||||||
|
|
||||||
// Count uptime
|
// Count uptime
|
||||||
MarkStartTime();
|
MarkStartTime();
|
||||||
|
fprintf(stderr,"%s tik14\n", __FUNCTION__);
|
||||||
|
|
||||||
if ((chainparams.NetworkIDString() != "regtest") &&
|
if ((chainparams.NetworkIDString() != "regtest") &&
|
||||||
GetBoolArg("-showmetrics", 0) &&
|
GetBoolArg("-showmetrics", 0) &&
|
||||||
@@ -1362,6 +1401,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
threadGroup.create_thread(&ThreadShowMetricsScreen);
|
threadGroup.create_thread(&ThreadShowMetricsScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik15\n", __FUNCTION__);
|
||||||
// These must be disabled for now, they are buggy and we probably don't
|
// These must be disabled for now, they are buggy and we probably don't
|
||||||
// want any of libsnark's profiling in production anyway.
|
// want any of libsnark's profiling in production anyway.
|
||||||
libsnark::inhibit_profiling_info = true;
|
libsnark::inhibit_profiling_info = true;
|
||||||
@@ -1383,6 +1423,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
if (!AppInitServers(threadGroup))
|
if (!AppInitServers(threadGroup))
|
||||||
return InitError(_("Unable to start HTTP server. See debug log for details."));
|
return InitError(_("Unable to start HTTP server. See debug log for details."));
|
||||||
}
|
}
|
||||||
|
fprintf(stderr,"%s tik16\n", __FUNCTION__);
|
||||||
|
|
||||||
int64_t nStart;
|
int64_t nStart;
|
||||||
|
|
||||||
@@ -1407,6 +1448,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
#endif // ENABLE_WALLET
|
#endif // ENABLE_WALLET
|
||||||
// ********************************************************* Step 6: network initialization
|
// ********************************************************* Step 6: network initialization
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik17\n", __FUNCTION__);
|
||||||
RegisterNodeSignals(GetNodeSignals());
|
RegisterNodeSignals(GetNodeSignals());
|
||||||
|
|
||||||
// sanitize comments per BIP-0014, format user agent and check total size
|
// sanitize comments per BIP-0014, format user agent and check total size
|
||||||
@@ -1422,6 +1464,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
return InitError(strprintf("Total length of network version string %i exceeds maximum of %i characters. Reduce the number and/or size of uacomments.",
|
return InitError(strprintf("Total length of network version string %i exceeds maximum of %i characters. Reduce the number and/or size of uacomments.",
|
||||||
strSubVersion.size(), MAX_SUBVERSION_LENGTH));
|
strSubVersion.size(), MAX_SUBVERSION_LENGTH));
|
||||||
}
|
}
|
||||||
|
fprintf(stderr,"%s tik18\n", __FUNCTION__);
|
||||||
|
|
||||||
if (mapArgs.count("-onlynet")) {
|
if (mapArgs.count("-onlynet")) {
|
||||||
std::set<enum Network> nets;
|
std::set<enum Network> nets;
|
||||||
@@ -1438,6 +1481,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik19\n", __FUNCTION__);
|
||||||
if (mapArgs.count("-whitelist")) {
|
if (mapArgs.count("-whitelist")) {
|
||||||
BOOST_FOREACH(const std::string& net, mapMultiArgs["-whitelist"]) {
|
BOOST_FOREACH(const std::string& net, mapMultiArgs["-whitelist"]) {
|
||||||
CSubNet subnet(net);
|
CSubNet subnet(net);
|
||||||
@@ -1463,6 +1507,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
SetNameProxy(addrProxy);
|
SetNameProxy(addrProxy);
|
||||||
SetLimited(NET_TOR, false); // by default, -proxy sets onion as reachable, unless -noonion later
|
SetLimited(NET_TOR, false); // by default, -proxy sets onion as reachable, unless -noonion later
|
||||||
}
|
}
|
||||||
|
fprintf(stderr,"%s tik20\n", __FUNCTION__);
|
||||||
|
|
||||||
// -onion can be used to set only a proxy for .onion, or override normal proxy for .onion addresses
|
// -onion can be used to set only a proxy for .onion, or override normal proxy for .onion addresses
|
||||||
// -noonion (or -onion=0) disables connecting to .onion entirely
|
// -noonion (or -onion=0) disables connecting to .onion entirely
|
||||||
@@ -1481,10 +1526,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// see Step 2: parameter interactions for more information about these
|
// see Step 2: parameter interactions for more information about these
|
||||||
fListen = GetBoolArg("-listen", DEFAULT_LISTEN);
|
fListen = GetBoolArg("-listen", DEFAULT_LISTEN);
|
||||||
fDiscover = GetBoolArg("-discover", true);
|
fDiscover = GetBoolArg("-discover", true);
|
||||||
fNameLookup = GetBoolArg("-dns", true);
|
fNameLookup = GetBoolArg("-dns", true);
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik22\n", __FUNCTION__);
|
||||||
bool fBound = false;
|
bool fBound = false;
|
||||||
if (fListen) {
|
if (fListen) {
|
||||||
if (mapArgs.count("-bind") || mapArgs.count("-whitebind")) {
|
if (mapArgs.count("-bind") || mapArgs.count("-whitebind")) {
|
||||||
@@ -1522,6 +1568,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik23\n", __FUNCTION__);
|
||||||
|
|
||||||
BOOST_FOREACH(const std::string& strDest, mapMultiArgs["-seednode"])
|
BOOST_FOREACH(const std::string& strDest, mapMultiArgs["-seednode"])
|
||||||
AddOneShot(strDest);
|
AddOneShot(strDest);
|
||||||
|
|
||||||
@@ -1561,6 +1609,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
return !fRequestShutdown;
|
return !fRequestShutdown;
|
||||||
}
|
}
|
||||||
// ********************************************************* Step 7: load block chain
|
// ********************************************************* Step 7: load block chain
|
||||||
|
fprintf(stderr,"%s tik24\n", __FUNCTION__);
|
||||||
|
|
||||||
fReindex = GetBoolArg("-reindex", false);
|
fReindex = GetBoolArg("-reindex", false);
|
||||||
|
|
||||||
@@ -1791,6 +1840,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
mempool.ReadFeeEstimates(est_filein);
|
mempool.ReadFeeEstimates(est_filein);
|
||||||
fFeeEstimatesInitialized = true;
|
fFeeEstimatesInitialized = true;
|
||||||
|
|
||||||
|
fprintf(stderr,"%s tik25\n", __FUNCTION__);
|
||||||
|
|
||||||
// ********************************************************* Step 8: load wallet
|
// ********************************************************* Step 8: load wallet
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
@@ -2063,9 +2113,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
if (pwalletMain) {
|
if (pwalletMain) {
|
||||||
|
fprintf(stderr,"%s reaccepting wallet xtns\n", __FUNCTION__);
|
||||||
// Add wallet transactions that aren't already in a block to mapTransactions
|
// Add wallet transactions that aren't already in a block to mapTransactions
|
||||||
pwalletMain->ReacceptWalletTransactions();
|
pwalletMain->ReacceptWalletTransactions();
|
||||||
|
|
||||||
|
fprintf(stderr,"%s starting wallet flusher thread\n", __FUNCTION__);
|
||||||
// Run a thread to flush wallet periodically
|
// Run a thread to flush wallet periodically
|
||||||
threadGroup.create_thread(boost::bind(&ThreadFlushWalletDB, boost::ref(pwalletMain->strWalletFile)));
|
threadGroup.create_thread(boost::bind(&ThreadFlushWalletDB, boost::ref(pwalletMain->strWalletFile)));
|
||||||
}
|
}
|
||||||
@@ -2074,5 +2126,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
// SENDALERT
|
// SENDALERT
|
||||||
threadGroup.create_thread(boost::bind(ThreadSendAlert));
|
threadGroup.create_thread(boost::bind(ThreadSendAlert));
|
||||||
|
|
||||||
|
fprintf(stderr,"%s end\n", __FUNCTION__);
|
||||||
return !fRequestShutdown;
|
return !fRequestShutdown;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user