diff options
author | Matt Corallo <git@bluematt.me> | 2016-12-18 23:26:20 -0800 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2017-01-05 10:32:07 -0500 |
commit | 69872195773870de8ee6521c9f555d60395a5ad9 (patch) | |
tree | 1908f376ec268604207ed61bab985c5e851d9e27 /src/validation.cpp | |
parent | 180586fd44c3154af846e18850c83d0ac1296787 (diff) |
Add a CValidationInterface::NewPoWValidBlock callback
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index d6bd789647..20d75d957f 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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 |