From 44dc49f6583910fb1cecf4512f3ab1e4db5dcb90 Mon Sep 17 00:00:00 2001 From: timemarkovqtum Date: Wed, 30 Oct 2024 12:25:01 +0100 Subject: [PATCH] Move the new valid block signal to the end of accept block --- src/validation.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/validation.cpp b/src/validation.cpp index 0e911990fb..b1d777b2cc 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -6085,9 +6085,6 @@ bool ChainstateManager::AcceptBlock(const std::shared_ptr& pblock, return error("%s: %s", __func__, state.ToString()); } - // 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) - // Write block to history file if (fNewBlock) *fNewBlock = true; try { @@ -6112,6 +6109,11 @@ bool ChainstateManager::AcceptBlock(const std::shared_ptr& pblock, CheckBlockIndex(); + // 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() && ActiveTip() == pindex->pprev) + GetMainSignals().NewPoWValidBlock(pindex, pblock); + return true; }