bool fUseMemoryLog;
enum Checkpoints::CPMode CheckpointsMode;
+// Ping and address broadcast intervals
+extern int64_t nPingInterval;
+extern int64_t nBroadcastInterval;
+
//////////////////////////////////////////////////////////////////////////////
//
// Shutdown
fUseMemoryLog = GetBoolArg("-memorylog", true);
nMinerSleep = GetArg("-minersleep", 500);
+ // Ping and address broadcast intervals
+ nPingInterval = max<int64_t>(10 * 60, GetArg("-keepalive", 30 * 60));
+
+ nBroadcastInterval = max<int64_t>(6 * 60 * 60, GetArg("-addrsetlifetime", 24 * 60 * 60));
+
CheckpointsMode = Checkpoints::STRICT;
std::string strCpMode = GetArg("-cppolicy", "strict");
- if(strCpMode == "strict")
+ if(strCpMode == "strict") {
CheckpointsMode = Checkpoints::STRICT;
+ }
- if(strCpMode == "advisory")
+ if(strCpMode == "advisory") {
CheckpointsMode = Checkpoints::ADVISORY;
+ }
- if(strCpMode == "permissive")
+ if(strCpMode == "permissive") {
CheckpointsMode = Checkpoints::PERMISSIVE;
+ }
nDerivationMethodIndex = 0;
int64_t nTransactionFee = MIN_TX_FEE;
int64_t nMinimumInputValue = MIN_TX_FEE;
+// Ping and address broadcast intervals
+int64_t nPingInterval = 30 * 60;
+int64_t nBroadcastInterval = 24 * 60 * 60;
+
extern enum Checkpoints::CPMode CheckpointsMode;
//////////////////////////////////////////////////////////////////////////////
// Keep-alive ping. We send a nonce of zero because we don't use it anywhere
// right now.
- if (pto->nLastSend && GetTime() - pto->nLastSend > 30 * 60 && pto->vSend.empty()) {
+ if (pto->nLastSend && GetTime() - pto->nLastSend > nPingInterval && pto->vSend.empty()) {
uint64_t nonce = 0;
if (pto->nVersion > BIP0031_VERSION)
pto->PushMessage("ping", nonce);
// Address refresh broadcast
static int64_t nLastRebroadcast;
- if (!IsInitialBlockDownload() && (GetTime() - nLastRebroadcast > 24 * 60 * 60))
+ if (!IsInitialBlockDownload() && (GetTime() - nLastRebroadcast > nBroadcastInterval))
{
{
LOCK(cs_vNodes);