Commit 397c8491 authored by coin-server's avatar coin-server

Merge branch 'fakestake_correction' into 'master'

corrections to fake stake code (thanks phore team)

See merge request ProjectMerge/merge!17
parents 23e4c554 c6804fb3
......@@ -3526,7 +3526,7 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex,
if (it == mapStakeSpent.end()) {
return false;
}
if (it->second <= pindexPrev->nHeight) {
if (it->second < pindexPrev->nHeight) {
return false;
}
}
......@@ -3538,7 +3538,7 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex,
CBlockIndex *last = pindexPrev;
// while that block is not on the main chain
while (!chainActive.Contains(last)) {
while (!chainActive.Contains(last) && last != NULL) {
CBlock bl;
ReadBlockFromDisk(bl, last);
// loop through every spent input from said block
......@@ -3556,7 +3556,7 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex,
}
// go to the parent block
last = pindexPrev->pprev;
last = last->pprev;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment