Add a CValidationInterface::NewPoWValidBlock callback

This commit is contained in:
Matt Corallo
2016-12-18 23:26:20 -08:00
parent 180586fd44
commit 6987219577
3 changed files with 14 additions and 0 deletions

View File

@@ -3096,6 +3096,11 @@ static bool AcceptBlock(const std::shared_ptr<const CBlock>& pblock, CValidation
return error("%s: %s", __func__, FormatStateMessage(state));
}
// Header is valid/has work, merkle tree and segwit merkle tree are good...RELAY NOW
// (but if it does not build on our best tip, let the SendMessages loop relay it)
if (!IsInitialBlockDownload() && chainActive.Tip() == pindex->pprev)
GetMainSignals().NewPoWValidBlock(pindex, pblock);
int nHeight = pindex->nHeight;
// Write block to history file