@ -199,7 +199,7 @@ void Shutdown()
StopTorControl ( ) ;
StopTorControl ( ) ;
UnregisterNodeSignals ( GetNodeSignals ( ) ) ;
UnregisterNodeSignals ( GetNodeSignals ( ) ) ;
if ( fDumpMempoolLater & & GetArg ( " -persistmempool " , DEFAULT_PERSIST_MEMPOOL ) ) {
if ( fDumpMempoolLater & & gArgs . GetArg ( " -persistmempool " , DEFAULT_PERSIST_MEMPOOL ) ) {
DumpMempool ( ) ;
DumpMempool ( ) ;
}
}
@ -321,7 +321,7 @@ void OnRPCPreCommand(const CRPCCommand& cmd)
{
{
// Observe safe mode
// Observe safe mode
std : : string strWarning = GetWarnings ( " rpc " ) ;
std : : string strWarning = GetWarnings ( " rpc " ) ;
if ( strWarning ! = " " & & ! GetBoolArg ( " -disablesafemode " , DEFAULT_DISABLE_SAFEMODE ) & &
if ( strWarning ! = " " & & ! gArgs . GetBoolArg ( " -disablesafemode " , DEFAULT_DISABLE_SAFEMODE ) & &
! cmd . okSafeMode )
! cmd . okSafeMode )
throw JSONRPCError ( RPC_FORBIDDEN_BY_SAFE_MODE , std : : string ( " Safe mode: " ) + strWarning ) ;
throw JSONRPCError ( RPC_FORBIDDEN_BY_SAFE_MODE , std : : string ( " Safe mode: " ) + strWarning ) ;
}
}
@ -332,7 +332,7 @@ std::string HelpMessage(HelpMessageMode mode)
const auto testnetBaseParams = CreateBaseChainParams ( CBaseChainParams : : TESTNET ) ;
const auto testnetBaseParams = CreateBaseChainParams ( CBaseChainParams : : TESTNET ) ;
const auto defaultChainParams = CreateChainParams ( CBaseChainParams : : MAIN ) ;
const auto defaultChainParams = CreateChainParams ( CBaseChainParams : : MAIN ) ;
const auto testnetChainParams = CreateChainParams ( CBaseChainParams : : TESTNET ) ;
const auto testnetChainParams = CreateChainParams ( CBaseChainParams : : TESTNET ) ;
const bool showDebug = GetBoolArg ( " -help-debug " , false ) ;
const bool showDebug = gArgs . GetBoolArg ( " -help-debug " , false ) ;
// When adding new options to the categories, please keep and ensure alphabetical ordering.
// When adding new options to the categories, please keep and ensure alphabetical ordering.
// Do not translate _(...) -help-debug options, Many technical terms, and only a very small audience, so is unnecessary stress to translators.
// Do not translate _(...) -help-debug options, Many technical terms, and only a very small audience, so is unnecessary stress to translators.
@ -546,7 +546,7 @@ static void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex
if ( initialSync | | ! pBlockIndex )
if ( initialSync | | ! pBlockIndex )
return ;
return ;
std : : string strCmd = GetArg ( " -blocknotify " , " " ) ;
std : : string strCmd = gArgs . GetArg ( " -blocknotify " , " " ) ;
boost : : replace_all ( strCmd , " %s " , pBlockIndex - > GetBlockHash ( ) . GetHex ( ) ) ;
boost : : replace_all ( strCmd , " %s " , pBlockIndex - > GetBlockHash ( ) . GetHex ( ) ) ;
boost : : thread t ( runCommand , strCmd ) ; // thread runs free
boost : : thread t ( runCommand , strCmd ) ; // thread runs free
@ -683,12 +683,12 @@ void ThreadImport(std::vector<fs::path> vImportFiles)
StartShutdown ( ) ;
StartShutdown ( ) ;
}
}
if ( GetBoolArg ( " -stopafterblockimport " , DEFAULT_STOPAFTERBLOCKIMPORT ) ) {
if ( gArgs . GetBoolArg ( " -stopafterblockimport " , DEFAULT_STOPAFTERBLOCKIMPORT ) ) {
LogPrintf ( " Stopping after block import \n " ) ;
LogPrintf ( " Stopping after block import \n " ) ;
StartShutdown ( ) ;
StartShutdown ( ) ;
}
}
} // End scope of CImportingNow
} // End scope of CImportingNow
if ( GetArg ( " -persistmempool " , DEFAULT_PERSIST_MEMPOOL ) ) {
if ( gArgs . GetArg ( " -persistmempool " , DEFAULT_PERSIST_MEMPOOL ) ) {
LoadMempool ( ) ;
LoadMempool ( ) ;
fDumpMempoolLater = ! fRequestShutdown ;
fDumpMempoolLater = ! fRequestShutdown ;
}
}
@ -727,7 +727,7 @@ bool AppInitServers(boost::thread_group& threadGroup)
return false ;
return false ;
if ( ! StartHTTPRPC ( ) )
if ( ! StartHTTPRPC ( ) )
return false ;
return false ;
if ( GetBoolArg ( " -rest " , DEFAULT_REST_ENABLE ) & & ! StartREST ( ) )
if ( gArgs . GetBoolArg ( " -rest " , DEFAULT_REST_ENABLE ) & & ! StartREST ( ) )
return false ;
return false ;
if ( ! StartHTTPServer ( ) )
if ( ! StartHTTPServer ( ) )
return false ;
return false ;
@ -739,61 +739,61 @@ void InitParameterInteraction()
{
{
// 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
if ( IsArgSet ( " -bind " ) ) {
if ( gArgs . IsArgSet ( " -bind " ) ) {
if ( SoftSetBoolArg ( " -listen " , true ) )
if ( gArgs . SoftSetBoolArg ( " -listen " , true ) )
LogPrintf ( " %s: parameter interaction: -bind set -> setting -listen=1 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -bind set -> setting -listen=1 \n " , __func__ ) ;
}
}
if ( IsArgSet ( " -whitebind " ) ) {
if ( gArgs . IsArgSet ( " -whitebind " ) ) {
if ( SoftSetBoolArg ( " -listen " , true ) )
if ( gArgs . SoftSetBoolArg ( " -listen " , true ) )
LogPrintf ( " %s: parameter interaction: -whitebind set -> setting -listen=1 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -whitebind set -> setting -listen=1 \n " , __func__ ) ;
}
}
if ( gArgs . IsArgSet ( " -connect " ) ) {
if ( gArgs . IsArgSet ( " -connect " ) ) {
// 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 ( gArgs . SoftSetBoolArg ( " -dnsseed " , false ) )
LogPrintf ( " %s: parameter interaction: -connect set -> setting -dnsseed=0 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -connect set -> setting -dnsseed=0 \n " , __func__ ) ;
if ( SoftSetBoolArg ( " -listen " , false ) )
if ( gArgs . SoftSetBoolArg ( " -listen " , false ) )
LogPrintf ( " %s: parameter interaction: -connect set -> setting -listen=0 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -connect set -> setting -listen=0 \n " , __func__ ) ;
}
}
if ( IsArgSet ( " -proxy " ) ) {
if ( gArgs . IsArgSet ( " -proxy " ) ) {
// to protect privacy, do not listen by default if a default proxy server is specified
// to protect privacy, do not listen by default if a default proxy server is specified
if ( SoftSetBoolArg ( " -listen " , false ) )
if ( gArgs . SoftSetBoolArg ( " -listen " , false ) )
LogPrintf ( " %s: parameter interaction: -proxy set -> setting -listen=0 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -proxy set -> setting -listen=0 \n " , __func__ ) ;
// to protect privacy, do not use UPNP when a proxy is set. The user may still specify -listen=1
// to protect privacy, do not use UPNP when a proxy is set. The user may still specify -listen=1
// to listen locally, so don't rely on this happening through -listen below.
// to listen locally, so don't rely on this happening through -listen below.
if ( SoftSetBoolArg ( " -upnp " , false ) )
if ( gArgs . SoftSetBoolArg ( " -upnp " , false ) )
LogPrintf ( " %s: parameter interaction: -proxy set -> setting -upnp=0 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -proxy set -> setting -upnp=0 \n " , __func__ ) ;
// to protect privacy, do not discover addresses by default
// to protect privacy, do not discover addresses by default
if ( SoftSetBoolArg ( " -discover " , false ) )
if ( gArgs . SoftSetBoolArg ( " -discover " , false ) )
LogPrintf ( " %s: parameter interaction: -proxy set -> setting -discover=0 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -proxy set -> setting -discover=0 \n " , __func__ ) ;
}
}
if ( ! GetBoolArg ( " -listen " , DEFAULT_LISTEN ) ) {
if ( ! gArgs . GetBoolArg ( " -listen " , DEFAULT_LISTEN ) ) {
// do not map ports or try to retrieve public IP when not listening (pointless)
// do not map ports or try to retrieve public IP when not listening (pointless)
if ( SoftSetBoolArg ( " -upnp " , false ) )
if ( gArgs . SoftSetBoolArg ( " -upnp " , false ) )
LogPrintf ( " %s: parameter interaction: -listen=0 -> setting -upnp=0 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -listen=0 -> setting -upnp=0 \n " , __func__ ) ;
if ( SoftSetBoolArg ( " -discover " , false ) )
if ( gArgs . SoftSetBoolArg ( " -discover " , false ) )
LogPrintf ( " %s: parameter interaction: -listen=0 -> setting -discover=0 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -listen=0 -> setting -discover=0 \n " , __func__ ) ;
if ( SoftSetBoolArg ( " -listenonion " , false ) )
if ( gArgs . SoftSetBoolArg ( " -listenonion " , false ) )
LogPrintf ( " %s: parameter interaction: -listen=0 -> setting -listenonion=0 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -listen=0 -> setting -listenonion=0 \n " , __func__ ) ;
}
}
if ( IsArgSet ( " -externalip " ) ) {
if ( gArgs . IsArgSet ( " -externalip " ) ) {
// if an explicit public IP is specified, do not try to find others
// if an explicit public IP is specified, do not try to find others
if ( SoftSetBoolArg ( " -discover " , false ) )
if ( gArgs . SoftSetBoolArg ( " -discover " , false ) )
LogPrintf ( " %s: parameter interaction: -externalip set -> setting -discover=0 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -externalip set -> setting -discover=0 \n " , __func__ ) ;
}
}
// disable whitelistrelay in blocksonly mode
// disable whitelistrelay in blocksonly mode
if ( GetBoolArg ( " -blocksonly " , DEFAULT_BLOCKSONLY ) ) {
if ( gArgs . GetBoolArg ( " -blocksonly " , DEFAULT_BLOCKSONLY ) ) {
if ( SoftSetBoolArg ( " -whitelistrelay " , false ) )
if ( gArgs . SoftSetBoolArg ( " -whitelistrelay " , false ) )
LogPrintf ( " %s: parameter interaction: -blocksonly=1 -> setting -whitelistrelay=0 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -blocksonly=1 -> setting -whitelistrelay=0 \n " , __func__ ) ;
}
}
// Forcing relay from whitelisted hosts implies we will accept relays from them in the first place.
// Forcing relay from whitelisted hosts implies we will accept relays from them in the first place.
if ( GetBoolArg ( " -whitelistforcerelay " , DEFAULT_WHITELISTFORCERELAY ) ) {
if ( gArgs . GetBoolArg ( " -whitelistforcerelay " , DEFAULT_WHITELISTFORCERELAY ) ) {
if ( SoftSetBoolArg ( " -whitelistrelay " , true ) )
if ( gArgs . SoftSetBoolArg ( " -whitelistrelay " , true ) )
LogPrintf ( " %s: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1 \n " , __func__ ) ;
LogPrintf ( " %s: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1 \n " , __func__ ) ;
}
}
}
}
@ -805,10 +805,10 @@ static std::string ResolveErrMsg(const char * const optname, const std::string&
void InitLogging ( )
void InitLogging ( )
{
{
fPrintToConsole = GetBoolArg ( " -printtoconsole " , false ) ;
fPrintToConsole = gArgs . GetBoolArg ( " -printtoconsole " , false ) ;
fLogTimestamps = GetBoolArg ( " -logtimestamps " , DEFAULT_LOGTIMESTAMPS ) ;
fLogTimestamps = gArgs . GetBoolArg ( " -logtimestamps " , DEFAULT_LOGTIMESTAMPS ) ;
fLogTimeMicros = GetBoolArg ( " -logtimemicros " , DEFAULT_LOGTIMEMICROS ) ;
fLogTimeMicros = gArgs . GetBoolArg ( " -logtimemicros " , DEFAULT_LOGTIMEMICROS ) ;
fLogIPs = GetBoolArg ( " -logips " , DEFAULT_LOGIPS ) ;
fLogIPs = gArgs . GetBoolArg ( " -logips " , DEFAULT_LOGIPS ) ;
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 ( " Bitcoin version %s \n " , FormatFullVersion ( ) ) ;
LogPrintf ( " Bitcoin version %s \n " , FormatFullVersion ( ) ) ;
@ -865,7 +865,7 @@ bool AppInitBasicSetup()
return InitError ( " Initializing networking failed " ) ;
return InitError ( " Initializing networking failed " ) ;
# ifndef WIN32
# ifndef WIN32
if ( ! GetBoolArg ( " -sysperms " , false ) ) {
if ( ! gArgs . GetBoolArg ( " -sysperms " , false ) ) {
umask ( 077 ) ;
umask ( 077 ) ;
}
}
@ -893,8 +893,8 @@ bool AppInitParameterInteraction()
// also see: InitParameterInteraction()
// also see: InitParameterInteraction()
// if using block pruning, then disallow txindex
// if using block pruning, then disallow txindex
if ( GetArg ( " -prune " , 0 ) ) {
if ( gArgs . GetArg ( " -prune " , 0 ) ) {
if ( GetBoolArg ( " -txindex " , DEFAULT_TXINDEX ) )
if ( gArgs . GetBoolArg ( " -txindex " , DEFAULT_TXINDEX ) )
return InitError ( _ ( " Prune mode is incompatible with -txindex. " ) ) ;
return InitError ( _ ( " Prune mode is incompatible with -txindex. " ) ) ;
}
}
@ -906,7 +906,7 @@ bool AppInitParameterInteraction()
// Make sure enough file descriptors are available
// Make sure enough file descriptors are available
int nBind = std : : max ( nUserBind , size_t ( 1 ) ) ;
int nBind = std : : max ( nUserBind , size_t ( 1 ) ) ;
nUserMaxConnections = GetArg ( " -maxconnections " , DEFAULT_MAX_PEER_CONNECTIONS ) ;
nUserMaxConnections = gArgs . GetArg ( " -maxconnections " , DEFAULT_MAX_PEER_CONNECTIONS ) ;
nMaxConnections = std : : max ( nUserMaxConnections , 0 ) ;
nMaxConnections = std : : max ( nUserMaxConnections , 0 ) ;
// Trim requested connection counts, to fit into system limitations
// Trim requested connection counts, to fit into system limitations
@ -947,55 +947,55 @@ bool AppInitParameterInteraction()
}
}
// Check for -debugnet
// Check for -debugnet
if ( GetBoolArg ( " -debugnet " , false ) )
if ( gArgs . GetBoolArg ( " -debugnet " , false ) )
InitWarning ( _ ( " Unsupported argument -debugnet ignored, use -debug=net. " ) ) ;
InitWarning ( _ ( " Unsupported argument -debugnet ignored, use -debug=net. " ) ) ;
// Check for -socks - as this is a privacy risk to continue, exit here
// Check for -socks - as this is a privacy risk to continue, exit here
if ( IsArgSet ( " -socks " ) )
if ( gArgs . IsArgSet ( " -socks " ) )
return InitError ( _ ( " Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. " ) ) ;
return InitError ( _ ( " Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. " ) ) ;
// Check for -tor - as this is a privacy risk to continue, exit here
// Check for -tor - as this is a privacy risk to continue, exit here
if ( GetBoolArg ( " -tor " , false ) )
if ( gArgs . GetBoolArg ( " -tor " , false ) )
return InitError ( _ ( " Unsupported argument -tor found, use -onion. " ) ) ;
return InitError ( _ ( " Unsupported argument -tor found, use -onion. " ) ) ;
if ( GetBoolArg ( " -benchmark " , false ) )
if ( gArgs . GetBoolArg ( " -benchmark " , false ) )
InitWarning ( _ ( " Unsupported argument -benchmark ignored, use -debug=bench. " ) ) ;
InitWarning ( _ ( " Unsupported argument -benchmark ignored, use -debug=bench. " ) ) ;
if ( GetBoolArg ( " -whitelistalwaysrelay " , false ) )
if ( gArgs . GetBoolArg ( " -whitelistalwaysrelay " , false ) )
InitWarning ( _ ( " Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay. " ) ) ;
InitWarning ( _ ( " Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay. " ) ) ;
if ( IsArgSet ( " -blockminsize " ) )
if ( gArgs . IsArgSet ( " -blockminsize " ) )
InitWarning ( " Unsupported argument -blockminsize ignored. " ) ;
InitWarning ( " Unsupported argument -blockminsize ignored. " ) ;
// Checkmempool and checkblockindex default to true in regtest mode
// Checkmempool and checkblockindex default to true in regtest mode
int ratio = std : : min < int > ( std : : max < int > ( GetArg ( " -checkmempool " , chainparams . DefaultConsistencyChecks ( ) ? 1 : 0 ) , 0 ) , 1000000 ) ;
int ratio = std : : min < int > ( std : : max < int > ( gArgs . GetArg ( " -checkmempool " , chainparams . DefaultConsistencyChecks ( ) ? 1 : 0 ) , 0 ) , 1000000 ) ;
if ( ratio ! = 0 ) {
if ( ratio ! = 0 ) {
mempool . setSanityCheck ( 1.0 / ratio ) ;
mempool . setSanityCheck ( 1.0 / ratio ) ;
}
}
fCheckBlockIndex = GetBoolArg ( " -checkblockindex " , chainparams . DefaultConsistencyChecks ( ) ) ;
fCheckBlockIndex = gArgs . GetBoolArg ( " -checkblockindex " , chainparams . DefaultConsistencyChecks ( ) ) ;
fCheckpointsEnabled = GetBoolArg ( " -checkpoints " , DEFAULT_CHECKPOINTS_ENABLED ) ;
fCheckpointsEnabled = gArgs . GetBoolArg ( " -checkpoints " , DEFAULT_CHECKPOINTS_ENABLED ) ;
hashAssumeValid = uint256S ( GetArg ( " -assumevalid " , chainparams . GetConsensus ( ) . defaultAssumeValid . GetHex ( ) ) ) ;
hashAssumeValid = uint256S ( gArgs . GetArg ( " -assumevalid " , chainparams . GetConsensus ( ) . defaultAssumeValid . GetHex ( ) ) ) ;
if ( ! hashAssumeValid . IsNull ( ) )
if ( ! hashAssumeValid . IsNull ( ) )
LogPrintf ( " Assuming ancestors of block %s have valid signatures. \n " , hashAssumeValid . GetHex ( ) ) ;
LogPrintf ( " Assuming ancestors of block %s have valid signatures. \n " , hashAssumeValid . GetHex ( ) ) ;
else
else
LogPrintf ( " Validating signatures for all blocks. \n " ) ;
LogPrintf ( " Validating signatures for all blocks. \n " ) ;
// mempool limits
// mempool limits
int64_t nMempoolSizeMax = GetArg ( " -maxmempool " , DEFAULT_MAX_MEMPOOL_SIZE ) * 1000000 ;
int64_t nMempoolSizeMax = gArgs . GetArg ( " -maxmempool " , DEFAULT_MAX_MEMPOOL_SIZE ) * 1000000 ;
int64_t nMempoolSizeMin = GetArg ( " -limitdescendantsize " , DEFAULT_DESCENDANT_SIZE_LIMIT ) * 1000 * 40 ;
int64_t nMempoolSizeMin = gArgs . GetArg ( " -limitdescendantsize " , DEFAULT_DESCENDANT_SIZE_LIMIT ) * 1000 * 40 ;
if ( nMempoolSizeMax < 0 | | nMempoolSizeMax < nMempoolSizeMin )
if ( nMempoolSizeMax < 0 | | nMempoolSizeMax < nMempoolSizeMin )
return InitError ( strprintf ( _ ( " -maxmempool must be at least %d MB " ) , std : : ceil ( nMempoolSizeMin / 1000000.0 ) ) ) ;
return InitError ( strprintf ( _ ( " -maxmempool must be at least %d MB " ) , std : : ceil ( nMempoolSizeMin / 1000000.0 ) ) ) ;
// incremental relay fee sets the minimum feerate increase necessary for BIP 125 replacement in the mempool
// incremental relay fee sets the minimum feerate increase necessary for BIP 125 replacement in the mempool
// and the amount the mempool min fee increases above the feerate of txs evicted due to mempool limiting.
// and the amount the mempool min fee increases above the feerate of txs evicted due to mempool limiting.
if ( IsArgSet ( " -incrementalrelayfee " ) )
if ( gArgs . IsArgSet ( " -incrementalrelayfee " ) )
{
{
CAmount n = 0 ;
CAmount n = 0 ;
if ( ! ParseMoney ( GetArg ( " -incrementalrelayfee " , " " ) , n ) )
if ( ! ParseMoney ( gArgs . GetArg ( " -incrementalrelayfee " , " " ) , n ) )
return InitError ( AmountErrMsg ( " incrementalrelayfee " , GetArg ( " -incrementalrelayfee " , " " ) ) ) ;
return InitError ( AmountErrMsg ( " incrementalrelayfee " , gArgs . GetArg ( " -incrementalrelayfee " , " " ) ) ) ;
incrementalRelayFee = CFeeRate ( n ) ;
incrementalRelayFee = CFeeRate ( n ) ;
}
}
// -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency
// -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency
nScriptCheckThreads = GetArg ( " -par " , DEFAULT_SCRIPTCHECK_THREADS ) ;
nScriptCheckThreads = gArgs . GetArg ( " -par " , DEFAULT_SCRIPTCHECK_THREADS ) ;
if ( nScriptCheckThreads < = 0 )
if ( nScriptCheckThreads < = 0 )
nScriptCheckThreads + = GetNumCores ( ) ;
nScriptCheckThreads + = GetNumCores ( ) ;
if ( nScriptCheckThreads < = 1 )
if ( nScriptCheckThreads < = 1 )
@ -1004,7 +1004,7 @@ bool AppInitParameterInteraction()
nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS ;
nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS ;
// block pruning; get the amount of disk space (in MiB) to allot for block & undo files
// block pruning; get the amount of disk space (in MiB) to allot for block & undo files
int64_t nPruneArg = GetArg ( " -prune " , 0 ) ;
int64_t nPruneArg = gArgs . GetArg ( " -prune " , 0 ) ;
if ( nPruneArg < 0 ) {
if ( nPruneArg < 0 ) {
return InitError ( _ ( " Prune cannot be configured with a negative value. " ) ) ;
return InitError ( _ ( " Prune cannot be configured with a negative value. " ) ) ;
}
}
@ -1026,14 +1026,14 @@ bool AppInitParameterInteraction()
RegisterWalletRPCCommands ( tableRPC ) ;
RegisterWalletRPCCommands ( tableRPC ) ;
# endif
# endif
nConnectTimeout = GetArg ( " -timeout " , DEFAULT_CONNECT_TIMEOUT ) ;
nConnectTimeout = gArgs . GetArg ( " -timeout " , DEFAULT_CONNECT_TIMEOUT ) ;
if ( nConnectTimeout < = 0 )
if ( nConnectTimeout < = 0 )
nConnectTimeout = DEFAULT_CONNECT_TIMEOUT ;
nConnectTimeout = DEFAULT_CONNECT_TIMEOUT ;
if ( IsArgSet ( " -minrelaytxfee " ) ) {
if ( gArgs . IsArgSet ( " -minrelaytxfee " ) ) {
CAmount n = 0 ;
CAmount n = 0 ;
if ( ! ParseMoney ( GetArg ( " -minrelaytxfee " , " " ) , n ) ) {
if ( ! ParseMoney ( gArgs . GetArg ( " -minrelaytxfee " , " " ) , n ) ) {
return InitError ( AmountErrMsg ( " minrelaytxfee " , GetArg ( " -minrelaytxfee " , " " ) ) ) ;
return InitError ( AmountErrMsg ( " minrelaytxfee " , gArgs . GetArg ( " -minrelaytxfee " , " " ) ) ) ;
}
}
// High fee check is done afterward in CWallet::ParameterInteraction()
// High fee check is done afterward in CWallet::ParameterInteraction()
: : minRelayTxFee = CFeeRate ( n ) ;
: : minRelayTxFee = CFeeRate ( n ) ;
@ -1045,55 +1045,55 @@ bool AppInitParameterInteraction()
// Sanity check argument for min fee for including tx in block
// Sanity check argument for min fee for including tx in block
// TODO: Harmonize which arguments need sanity checking and where that happens
// TODO: Harmonize which arguments need sanity checking and where that happens
if ( IsArgSet ( " -blockmintxfee " ) )
if ( gArgs . IsArgSet ( " -blockmintxfee " ) )
{
{
CAmount n = 0 ;
CAmount n = 0 ;
if ( ! ParseMoney ( GetArg ( " -blockmintxfee " , " " ) , n ) )
if ( ! ParseMoney ( gArgs . GetArg ( " -blockmintxfee " , " " ) , n ) )
return InitError ( AmountErrMsg ( " blockmintxfee " , GetArg ( " -blockmintxfee " , " " ) ) ) ;
return InitError ( AmountErrMsg ( " blockmintxfee " , gArgs . GetArg ( " -blockmintxfee " , " " ) ) ) ;
}
}
// Feerate used to define dust. Shouldn't be changed lightly as old
// Feerate used to define dust. Shouldn't be changed lightly as old
// implementations may inadvertently create non-standard transactions
// implementations may inadvertently create non-standard transactions
if ( IsArgSet ( " -dustrelayfee " ) )
if ( gArgs . IsArgSet ( " -dustrelayfee " ) )
{
{
CAmount n = 0 ;
CAmount n = 0 ;
if ( ! ParseMoney ( GetArg ( " -dustrelayfee " , " " ) , n ) | | 0 = = n )
if ( ! ParseMoney ( gArgs . GetArg ( " -dustrelayfee " , " " ) , n ) | | 0 = = n )
return InitError ( AmountErrMsg ( " dustrelayfee " , GetArg ( " -dustrelayfee " , " " ) ) ) ;
return InitError ( AmountErrMsg ( " dustrelayfee " , gArgs . GetArg ( " -dustrelayfee " , " " ) ) ) ;
dustRelayFee = CFeeRate ( n ) ;
dustRelayFee = CFeeRate ( n ) ;
}
}
fRequireStandard = ! GetBoolArg ( " -acceptnonstdtxn " , ! chainparams . RequireStandard ( ) ) ;
fRequireStandard = ! gArgs . GetBoolArg ( " -acceptnonstdtxn " , ! chainparams . RequireStandard ( ) ) ;
if ( chainparams . RequireStandard ( ) & & ! fRequireStandard )
if ( chainparams . RequireStandard ( ) & & ! fRequireStandard )
return InitError ( strprintf ( " acceptnonstdtxn is not currently supported for %s chain " , chainparams . NetworkIDString ( ) ) ) ;
return InitError ( strprintf ( " acceptnonstdtxn is not currently supported for %s chain " , chainparams . NetworkIDString ( ) ) ) ;
nBytesPerSigOp = GetArg ( " -bytespersigop " , nBytesPerSigOp ) ;
nBytesPerSigOp = gArgs . GetArg ( " -bytespersigop " , nBytesPerSigOp ) ;
# ifdef ENABLE_WALLET
# ifdef ENABLE_WALLET
if ( ! CWallet : : ParameterInteraction ( ) )
if ( ! CWallet : : ParameterInteraction ( ) )
return false ;
return false ;
# endif
# endif
fIsBareMultisigStd = GetBoolArg ( " -permitbaremultisig " , DEFAULT_PERMIT_BAREMULTISIG ) ;
fIsBareMultisigStd = gArgs . GetBoolArg ( " -permitbaremultisig " , DEFAULT_PERMIT_BAREMULTISIG ) ;
fAcceptDatacarrier = GetBoolArg ( " -datacarrier " , DEFAULT_ACCEPT_DATACARRIER ) ;
fAcceptDatacarrier = gArgs . GetBoolArg ( " -datacarrier " , DEFAULT_ACCEPT_DATACARRIER ) ;
nMaxDatacarrierBytes = GetArg ( " -datacarriersize " , nMaxDatacarrierBytes ) ;
nMaxDatacarrierBytes = gArgs . GetArg ( " -datacarriersize " , nMaxDatacarrierBytes ) ;
// Option to startup with mocktime set (used for regression testing):
// Option to startup with mocktime set (used for regression testing):
SetMockTime ( GetArg ( " -mocktime " , 0 ) ) ; // SetMockTime(0) is a no-op
SetMockTime ( gArgs . GetArg ( " -mocktime " , 0 ) ) ; // SetMockTime(0) is a no-op
if ( GetBoolArg ( " -peerbloomfilters " , DEFAULT_PEERBLOOMFILTERS ) )
if ( gArgs . GetBoolArg ( " -peerbloomfilters " , DEFAULT_PEERBLOOMFILTERS ) )
nLocalServices = ServiceFlags ( nLocalServices | NODE_BLOOM ) ;
nLocalServices = ServiceFlags ( nLocalServices | NODE_BLOOM ) ;
if ( GetArg ( " -rpcserialversion " , DEFAULT_RPC_SERIALIZE_VERSION ) < 0 )
if ( gArgs . GetArg ( " -rpcserialversion " , DEFAULT_RPC_SERIALIZE_VERSION ) < 0 )
return InitError ( " rpcserialversion must be non-negative. " ) ;
return InitError ( " rpcserialversion must be non-negative. " ) ;
if ( GetArg ( " -rpcserialversion " , DEFAULT_RPC_SERIALIZE_VERSION ) > 1 )
if ( gArgs . GetArg ( " -rpcserialversion " , DEFAULT_RPC_SERIALIZE_VERSION ) > 1 )
return InitError ( " unknown rpcserialversion requested. " ) ;
return InitError ( " unknown rpcserialversion requested. " ) ;
nMaxTipAge = GetArg ( " -maxtipage " , DEFAULT_MAX_TIP_AGE ) ;
nMaxTipAge = gArgs . GetArg ( " -maxtipage " , DEFAULT_MAX_TIP_AGE ) ;
fEnableReplacement = GetBoolArg ( " -mempoolreplacement " , DEFAULT_ENABLE_REPLACEMENT ) ;
fEnableReplacement = gArgs . GetBoolArg ( " -mempoolreplacement " , DEFAULT_ENABLE_REPLACEMENT ) ;
if ( ( ! fEnableReplacement ) & & IsArgSet ( " -mempoolreplacement " ) ) {
if ( ( ! fEnableReplacement ) & & gArgs . IsArgSet ( " -mempoolreplacement " ) ) {
// Minimal effort at forwards compatibility
// Minimal effort at forwards compatibility
std : : string strReplacementModeList = GetArg ( " -mempoolreplacement " , " " ) ; // default is impossible
std : : string strReplacementModeList = gArgs . GetArg ( " -mempoolreplacement " , " " ) ; // default is impossible
std : : vector < std : : string > vstrReplacementModes ;
std : : vector < std : : string > vstrReplacementModes ;
boost : : split ( vstrReplacementModes , strReplacementModeList , boost : : is_any_of ( " , " ) ) ;
boost : : split ( vstrReplacementModes , strReplacementModeList , boost : : is_any_of ( " , " ) ) ;
fEnableReplacement = ( std : : find ( vstrReplacementModes . begin ( ) , vstrReplacementModes . end ( ) , " fee " ) ! = vstrReplacementModes . end ( ) ) ;
fEnableReplacement = ( std : : find ( vstrReplacementModes . begin ( ) , vstrReplacementModes . end ( ) , " fee " ) ! = vstrReplacementModes . end ( ) ) ;
@ -1198,7 +1198,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
# ifndef WIN32
# ifndef WIN32
CreatePidFile ( GetPidFile ( ) , getpid ( ) ) ;
CreatePidFile ( GetPidFile ( ) , getpid ( ) ) ;
# endif
# endif
if ( GetBoolArg ( " -shrinkdebugfile " , logCategories = = BCLog : : NONE ) ) {
if ( gArgs . GetBoolArg ( " -shrinkdebugfile " , logCategories = = BCLog : : NONE ) ) {
// Do this first since it both loads a bunch of debug.log into memory,
// Do this first since it both loads a bunch of debug.log into memory,
// and because this needs to happen before any other debug.log printing
// and because this needs to happen before any other debug.log printing
ShrinkDebugFile ( ) ;
ShrinkDebugFile ( ) ;
@ -1211,7 +1211,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
LogPrintf ( " Startup time: %s \n " , DateTimeStrFormat ( " %Y-%m-%d %H:%M:%S " , GetTime ( ) ) ) ;
LogPrintf ( " Startup time: %s \n " , DateTimeStrFormat ( " %Y-%m-%d %H:%M:%S " , GetTime ( ) ) ) ;
LogPrintf ( " Default data directory %s \n " , GetDefaultDataDir ( ) . string ( ) ) ;
LogPrintf ( " Default data directory %s \n " , GetDefaultDataDir ( ) . string ( ) ) ;
LogPrintf ( " Using data directory %s \n " , GetDataDir ( ) . string ( ) ) ;
LogPrintf ( " Using data directory %s \n " , GetDataDir ( ) . string ( ) ) ;
LogPrintf ( " Using config file %s \n " , GetConfigFile ( GetArg ( " -conf " , BITCOIN_CONF_FILENAME ) ) . string ( ) ) ;
LogPrintf ( " Using config file %s \n " , GetConfigFile ( gArgs . GetArg ( " -conf " , BITCOIN_CONF_FILENAME ) ) . string ( ) ) ;
LogPrintf ( " Using at most %i automatic connections (%i file descriptors available) \n " , nMaxConnections , nFD ) ;
LogPrintf ( " Using at most %i automatic connections (%i file descriptors available) \n " , nMaxConnections , nFD ) ;
InitSignatureCache ( ) ;
InitSignatureCache ( ) ;
@ -1234,7 +1234,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
* that the server is there and will be ready later ) . Warmup mode will
* that the server is there and will be ready later ) . Warmup mode will
* be disabled when initialisation is finished .
* be disabled when initialisation is finished .
*/
*/
if ( GetBoolArg ( " -server " , false ) )
if ( gArgs . GetBoolArg ( " -server " , false ) )
{
{
uiInterface . InitMessage . connect ( SetRPCWarmupStatus ) ;
uiInterface . InitMessage . connect ( SetRPCWarmupStatus ) ;
if ( ! AppInitServers ( threadGroup ) )
if ( ! AppInitServers ( threadGroup ) )
@ -1291,12 +1291,12 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
}
}
// Check for host lookup allowed before parsing any network related parameters
// Check for host lookup allowed before parsing any network related parameters
fNameLookup = GetBoolArg ( " -dns " , DEFAULT_NAME_LOOKUP ) ;
fNameLookup = gArgs . GetBoolArg ( " -dns " , DEFAULT_NAME_LOOKUP ) ;
bool proxyRandomize = GetBoolArg ( " -proxyrandomize " , DEFAULT_PROXYRANDOMIZE ) ;
bool proxyRandomize = gArgs . GetBoolArg ( " -proxyrandomize " , DEFAULT_PROXYRANDOMIZE ) ;
// -proxy sets a proxy for all outgoing network traffic
// -proxy sets a proxy for all outgoing network traffic
// -noproxy (or -proxy=0) as well as the empty string can be used to not set a proxy, this is the default
// -noproxy (or -proxy=0) as well as the empty string can be used to not set a proxy, this is the default
std : : string proxyArg = GetArg ( " -proxy " , " " ) ;
std : : string proxyArg = gArgs . GetArg ( " -proxy " , " " ) ;
SetLimited ( NET_TOR ) ;
SetLimited ( NET_TOR ) ;
if ( proxyArg ! = " " & & proxyArg ! = " 0 " ) {
if ( proxyArg ! = " " & & proxyArg ! = " 0 " ) {
CService proxyAddr ;
CService proxyAddr ;
@ -1318,7 +1318,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
// -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
// An empty string is used to not override the onion proxy (in which case it defaults to -proxy set above, or none)
// An empty string is used to not override the onion proxy (in which case it defaults to -proxy set above, or none)
std : : string onionArg = GetArg ( " -onion " , " " ) ;
std : : string onionArg = gArgs . GetArg ( " -onion " , " " ) ;
if ( onionArg ! = " " ) {
if ( onionArg ! = " " ) {
if ( onionArg = = " 0 " ) { // Handle -noonion/-onion=0
if ( onionArg = = " 0 " ) { // Handle -noonion/-onion=0
SetLimited ( NET_TOR ) ; // set onions as unreachable
SetLimited ( NET_TOR ) ; // set onions as unreachable
@ -1336,9 +1336,9 @@ bool AppInitMain(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 = gArgs . GetBoolArg ( " -listen " , DEFAULT_LISTEN ) ;
fDiscover = GetBoolArg ( " -discover " , true ) ;
fDiscover = gArgs . GetBoolArg ( " -discover " , true ) ;
fRelayTxes = ! GetBoolArg ( " -blocksonly " , DEFAULT_BLOCKSONLY ) ;
fRelayTxes = ! gArgs . GetBoolArg ( " -blocksonly " , DEFAULT_BLOCKSONLY ) ;
for ( const std : : string & strAddr : gArgs . GetArgs ( " -externalip " ) ) {
for ( const std : : string & strAddr : gArgs . GetArgs ( " -externalip " ) ) {
CService addrLocal ;
CService addrLocal ;
@ -1358,27 +1358,27 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
uint64_t nMaxOutboundLimit = 0 ; //unlimited unless -maxuploadtarget is set
uint64_t nMaxOutboundLimit = 0 ; //unlimited unless -maxuploadtarget is set
uint64_t nMaxOutboundTimeframe = MAX_UPLOAD_TIMEFRAME ;
uint64_t nMaxOutboundTimeframe = MAX_UPLOAD_TIMEFRAME ;
if ( IsArgSet ( " -maxuploadtarget " ) ) {
if ( gArgs . IsArgSet ( " -maxuploadtarget " ) ) {
nMaxOutboundLimit = GetArg ( " -maxuploadtarget " , DEFAULT_MAX_UPLOAD_TARGET ) * 1024 * 1024 ;
nMaxOutboundLimit = gArgs . GetArg ( " -maxuploadtarget " , DEFAULT_MAX_UPLOAD_TARGET ) * 1024 * 1024 ;
}
}
// ********************************************************* Step 7: load block chain
// ********************************************************* Step 7: load block chain
fReindex = GetBoolArg ( " -reindex " , false ) ;
fReindex = gArgs . GetBoolArg ( " -reindex " , false ) ;
bool fReindexChainState = GetBoolArg ( " -reindex-chainstate " , false ) ;
bool fReindexChainState = gArgs . GetBoolArg ( " -reindex-chainstate " , false ) ;
// cache size calculations
// cache size calculations
int64_t nTotalCache = ( GetArg ( " -dbcache " , nDefaultDbCache ) < < 20 ) ;
int64_t nTotalCache = ( gArgs . GetArg ( " -dbcache " , nDefaultDbCache ) < < 20 ) ;
nTotalCache = std : : max ( nTotalCache , nMinDbCache < < 20 ) ; // total cache cannot be less than nMinDbCache
nTotalCache = std : : max ( nTotalCache , nMinDbCache < < 20 ) ; // total cache cannot be less than nMinDbCache
nTotalCache = std : : min ( nTotalCache , nMaxDbCache < < 20 ) ; // total cache cannot be greater than nMaxDbcache
nTotalCache = std : : min ( nTotalCache , nMaxDbCache < < 20 ) ; // total cache cannot be greater than nMaxDbcache
int64_t nBlockTreeDBCache = nTotalCache / 8 ;
int64_t nBlockTreeDBCache = nTotalCache / 8 ;
nBlockTreeDBCache = std : : min ( nBlockTreeDBCache , ( GetBoolArg ( " -txindex " , DEFAULT_TXINDEX ) ? nMaxBlockDBAndTxIndexCache : nMaxBlockDBCache ) < < 20 ) ;
nBlockTreeDBCache = std : : min ( nBlockTreeDBCache , ( gArgs . GetBoolArg ( " -txindex " , DEFAULT_TXINDEX ) ? nMaxBlockDBAndTxIndexCache : nMaxBlockDBCache ) < < 20 ) ;
nTotalCache - = nBlockTreeDBCache ;
nTotalCache - = nBlockTreeDBCache ;
int64_t nCoinDBCache = std : : min ( nTotalCache / 2 , ( nTotalCache / 4 ) + ( 1 < < 23 ) ) ; // use 25%-50% of the remainder for disk cache
int64_t nCoinDBCache = std : : min ( nTotalCache / 2 , ( nTotalCache / 4 ) + ( 1 < < 23 ) ) ; // use 25%-50% of the remainder for disk cache
nCoinDBCache = std : : min ( nCoinDBCache , nMaxCoinsDBCache < < 20 ) ; // cap total coins db cache
nCoinDBCache = std : : min ( nCoinDBCache , nMaxCoinsDBCache < < 20 ) ; // cap total coins db cache
nTotalCache - = nCoinDBCache ;
nTotalCache - = nCoinDBCache ;
nCoinCacheUsage = nTotalCache ; // the rest goes to in-memory cache
nCoinCacheUsage = nTotalCache ; // the rest goes to in-memory cache
int64_t nMempoolSizeMax = GetArg ( " -maxmempool " , DEFAULT_MAX_MEMPOOL_SIZE ) * 1000000 ;
int64_t nMempoolSizeMax = gArgs . GetArg ( " -maxmempool " , DEFAULT_MAX_MEMPOOL_SIZE ) * 1000000 ;
LogPrintf ( " Cache configuration: \n " ) ;
LogPrintf ( " Cache configuration: \n " ) ;
LogPrintf ( " * Using %.1fMiB for block index database \n " , nBlockTreeDBCache * ( 1.0 / 1024 / 1024 ) ) ;
LogPrintf ( " * Using %.1fMiB for block index database \n " , nBlockTreeDBCache * ( 1.0 / 1024 / 1024 ) ) ;
LogPrintf ( " * Using %.1fMiB for chain state database \n " , nCoinDBCache * ( 1.0 / 1024 / 1024 ) ) ;
LogPrintf ( " * Using %.1fMiB for chain state database \n " , nCoinDBCache * ( 1.0 / 1024 / 1024 ) ) ;
@ -1427,7 +1427,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
return InitError ( _ ( " Incorrect or no genesis block found. Wrong datadir for network? " ) ) ;
return InitError ( _ ( " Incorrect or no genesis block found. Wrong datadir for network? " ) ) ;
// Check for changed -txindex state
// Check for changed -txindex state
if ( fTxIndex ! = GetBoolArg ( " -txindex " , DEFAULT_TXINDEX ) ) {
if ( fTxIndex ! = gArgs . GetBoolArg ( " -txindex " , DEFAULT_TXINDEX ) ) {
strLoadError = _ ( " You need to rebuild the database using -reindex-chainstate to change -txindex " ) ;
strLoadError = _ ( " You need to rebuild the database using -reindex-chainstate to change -txindex " ) ;
break ;
break ;
}
}
@ -1493,7 +1493,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
if ( ! is_coinsview_empty ) {
if ( ! is_coinsview_empty ) {
uiInterface . InitMessage ( _ ( " Verifying blocks... " ) ) ;
uiInterface . InitMessage ( _ ( " Verifying blocks... " ) ) ;
if ( fHavePruned & & GetArg ( " -checkblocks " , DEFAULT_CHECKBLOCKS ) > MIN_BLOCKS_TO_KEEP ) {
if ( fHavePruned & & gArgs . GetArg ( " -checkblocks " , DEFAULT_CHECKBLOCKS ) > MIN_BLOCKS_TO_KEEP ) {
LogPrintf ( " Prune: pruned datadir may not have more than %d blocks; only checking available blocks " ,
LogPrintf ( " Prune: pruned datadir may not have more than %d blocks; only checking available blocks " ,
MIN_BLOCKS_TO_KEEP ) ;
MIN_BLOCKS_TO_KEEP ) ;
}
}
@ -1510,8 +1510,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
}
}
}
}
if ( ! CVerifyDB ( ) . VerifyDB ( chainparams , pcoinsdbview , GetArg ( " -checklevel " , DEFAULT_CHECKLEVEL ) ,
if ( ! CVerifyDB ( ) . VerifyDB ( chainparams , pcoinsdbview , gArgs . GetArg ( " -checklevel " , DEFAULT_CHECKLEVEL ) ,
GetArg ( " -checkblocks " , DEFAULT_CHECKBLOCKS ) ) ) {
gArgs . GetArg ( " -checkblocks " , DEFAULT_CHECKBLOCKS ) ) ) {
strLoadError = _ ( " Corrupted block database detected " ) ;
strLoadError = _ ( " Corrupted block database detected " ) ;
break ;
break ;
}
}
@ -1610,7 +1610,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
fHaveGenesis = true ;
fHaveGenesis = true ;
}
}
if ( IsArgSet ( " -blocknotify " ) )
if ( gArgs . IsArgSet ( " -blocknotify " ) )
uiInterface . NotifyBlockTip . connect ( BlockNotifyCallback ) ;
uiInterface . NotifyBlockTip . connect ( BlockNotifyCallback ) ;
std : : vector < fs : : path > vImportFiles ;
std : : vector < fs : : path > vImportFiles ;
@ -1634,13 +1634,13 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
//// debug print
//// debug print
LogPrintf ( " mapBlockIndex.size() = %u \n " , mapBlockIndex . size ( ) ) ;
LogPrintf ( " mapBlockIndex.size() = %u \n " , mapBlockIndex . size ( ) ) ;
LogPrintf ( " nBestHeight = %d \n " , chainActive . Height ( ) ) ;
LogPrintf ( " nBestHeight = %d \n " , chainActive . Height ( ) ) ;
if ( GetBoolArg ( " -listenonion " , DEFAULT_LISTEN_ONION ) )
if ( gArgs . GetBoolArg ( " -listenonion " , DEFAULT_LISTEN_ONION ) )
StartTorControl ( threadGroup , scheduler ) ;
StartTorControl ( threadGroup , scheduler ) ;
Discover ( threadGroup ) ;
Discover ( threadGroup ) ;
// Map ports with UPnP
// Map ports with UPnP
MapPort ( GetBoolArg ( " -upnp " , DEFAULT_UPNP ) ) ;
MapPort ( gArgs . GetBoolArg ( " -upnp " , DEFAULT_UPNP ) ) ;
CConnman : : Options connOptions ;
CConnman : : Options connOptions ;
connOptions . nLocalServices = nLocalServices ;
connOptions . nLocalServices = nLocalServices ;
@ -1651,8 +1651,8 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
connOptions . nMaxFeeler = 1 ;
connOptions . nMaxFeeler = 1 ;
connOptions . nBestHeight = chainActive . Height ( ) ;
connOptions . nBestHeight = chainActive . Height ( ) ;
connOptions . uiInterface = & uiInterface ;
connOptions . uiInterface = & uiInterface ;
connOptions . nSendBufferMaxSize = 1000 * GetArg ( " -maxsendbuffer " , DEFAULT_MAXSENDBUFFER ) ;
connOptions . nSendBufferMaxSize = 1000 * gArgs . GetArg ( " -maxsendbuffer " , DEFAULT_MAXSENDBUFFER ) ;
connOptions . nReceiveFloodSize = 1000 * GetArg ( " -maxreceivebuffer " , DEFAULT_MAXRECEIVEBUFFER ) ;
connOptions . nReceiveFloodSize = 1000 * gArgs . GetArg ( " -maxreceivebuffer " , DEFAULT_MAXRECEIVEBUFFER ) ;
connOptions . nMaxOutboundTimeframe = nMaxOutboundTimeframe ;
connOptions . nMaxOutboundTimeframe = nMaxOutboundTimeframe ;
connOptions . nMaxOutboundLimit = nMaxOutboundLimit ;
connOptions . nMaxOutboundLimit = nMaxOutboundLimit ;