aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2016-12-18 23:26:20 -0800
committerMatt Corallo <git@bluematt.me>2017-01-05 10:32:07 -0500
commit69872195773870de8ee6521c9f555d60395a5ad9 (patch)
tree1908f376ec268604207ed61bab985c5e851d9e27 /src/validation.cpp
parent180586fd44c3154af846e18850c83d0ac1296787 (diff)
Add a CValidationInterface::NewPoWValidBlock callback
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp5
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