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;
//////////////////////////////////////////////////////////////////////////////
}
// miner's coin stake reward based on nBits and coin age spent (coin-days)
-int64_t GetProofOfStakeReward(int64_t nCoinAge, unsigned int nBits, unsigned int nTime, bool bCoinYearOnly)
+int64_t GetProofOfStakeReward(int64_t nCoinAge, unsigned int nBits, int64_t nTime, bool bCoinYearOnly)
{
int64_t nRewardCoinYear, nSubsidy, nSubsidyLimit = 10 * COIN;
}
}
+void UnloadBlockIndex()
+{
+ mapBlockIndex.clear();
+ setStakeSeen.clear();
+ pindexGenesisBlock = NULL;
+ nBestHeight = 0;
+ nBestChainTrust = 0;
+ nBestInvalidTrust = 0;
+ hashBestChain = 0;
+ pindexBest = NULL;
+}
+
bool LoadBlockIndex(bool fAllowNew)
{
if (fTestNet)
// 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);