diff options
| author | Matt Corallo <[email protected]> | 2018-06-11 15:13:04 -0400 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2018-06-11 17:21:13 -0400 |
| commit | f74894480db5dfbf49534499f489357ee9984183 (patch) | |
| tree | 9d0c09a941fdb3a664bbcadec9676975653315e7 /src/validation.cpp | |
| parent | rpc: Avoid "duplicate" return value for invalid submitblock (diff) | |
| download | discoin-f74894480db5dfbf49534499f489357ee9984183.tar.xz discoin-f74894480db5dfbf49534499f489357ee9984183.zip | |
Only set fNewBlock to true in AcceptBlock when we write to disk
The only affect this should have is fixing the return code in
submitblock in cases where a block fails ContextualCheckBlock and
not setting nLastBlockTime on peers that provide blocks which fail
ContextualCheckBlock (which is only used in eviction and cosmetic).
Diffstat (limited to 'src/validation.cpp')
| -rw-r--r-- | src/validation.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 9791d6e2d..dbfbfc16a 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3513,7 +3513,6 @@ bool CChainState::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, CVali // request; don't process these. if (pindex->nChainWork < nMinimumChainWork) return true; } - if (fNewBlock) *fNewBlock = true; if (!CheckBlock(block, state, chainparams.GetConsensus()) || !ContextualCheckBlock(block, state, chainparams.GetConsensus(), pindex->pprev)) { @@ -3530,6 +3529,7 @@ bool CChainState::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, CVali GetMainSignals().NewPoWValidBlock(pindex, pblock); // Write block to history file + if (fNewBlock) *fNewBlock = true; try { CDiskBlockPos blockPos = SaveBlockToDisk(block, pindex->nHeight, chainparams, dbp); if (blockPos.IsNull()) { |