Merge pull request #5 from miketout/dev

Reduce default difficulty, fix maturity signed vs. unsigned
This commit is contained in:
miketout
2018-05-06 13:09:22 -07:00
committed by GitHub
3 changed files with 6 additions and 5 deletions

View File

@@ -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)

View File

@@ -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");
}

View File

@@ -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);
}