From 39267c35531626b2095b15cca13f92bbb1814673 Mon Sep 17 00:00:00 2001 From: miketout Date: Sun, 6 May 2018 13:06:14 -0700 Subject: [PATCH] Reduce default difficulty --- src/chainparams.cpp | 2 +- src/main.cpp | 3 ++- src/wallet/wallet.cpp | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index c2b005dd0..af943aba6 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -241,7 +241,7 @@ void *chainparams_commandline(void *ptr) // nLwmaAjustedWeight = (N+1)/2 * (0.9989^(500/nPowAveragingWindow)) * nPowTargetSpacing mainParams.consensus.nLwmaAjustedWeight = 1350; mainParams.consensus.nPowAveragingWindow = 45; - mainParams.consensus.powAlternate = uint256S("0000000f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f"); + mainParams.consensus.powAlternate = uint256S("00000f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f"); } checkpointData = //(Checkpoints::CCheckpointData) diff --git a/src/main.cpp b/src/main.cpp index 195d5deb7..fb9301225 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3938,7 +3938,8 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta // Check proof of work if ( (ASSETCHAINS_SYMBOL[0] != 0 || nHeight < 235300 || nHeight > 236000) && block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams)) { - cout << block.nBits << " block.nBits vs. calc " << GetNextWorkRequired(pindexPrev, &block, consensusParams) << endl; + cout << block.nBits << " block.nBits vs. calc " << GetNextWorkRequired(pindexPrev, &block, consensusParams) << + " for block #" << nHeight << endl; return state.DoS(100, error("%s: incorrect proof of work", __func__), REJECT_INVALID, "bad-diffbits"); } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index fc5cc36ae..5ffaed5fd 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3919,9 +3919,9 @@ int CMerkleTx::GetBlocksToMaturity() const COINBASE_MATURITY = _COINBASE_MATURITY; if (!IsCoinBase()) return 0; - uint32_t depth = GetDepthInMainChain(); - uint32_t ui; - uint32_t toMaturity = (ui = UnlockTime(0) - chainActive.Height()) < 0 ? 0 : ui; + int32_t depth = GetDepthInMainChain(); + int32_t ui; + int32_t toMaturity = (ui = UnlockTime(0) - chainActive.Height()) < 0 ? 0 : ui; return((ui = COINBASE_MATURITY - depth) < toMaturity ? toMaturity : ui); }