aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorMatt Corallo <[email protected]>2016-12-18 23:26:20 -0800
committerMatt Corallo <[email protected]>2017-01-05 10:32:07 -0500
commit69872195773870de8ee6521c9f555d60395a5ad9 (patch)
tree1908f376ec268604207ed61bab985c5e851d9e27 /src/validation.cpp
parentCall AcceptBlock with the block's shared_ptr instead of CBlock& (diff)
downloaddiscoin-69872195773870de8ee6521c9f555d60395a5ad9.tar.xz
discoin-69872195773870de8ee6521c9f555d60395a5ad9.zip
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 d6bd78964..20d75d957 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