Skip to content

Commit 44dc49f

Browse files
author
timemarkovqtum
committed
Move the new valid block signal to the end of accept block
1 parent 2ca33e4 commit 44dc49f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/validation.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6085,9 +6085,6 @@ bool ChainstateManager::AcceptBlock(const std::shared_ptr<const CBlock>& pblock,
60856085
return error("%s: %s", __func__, state.ToString());
60866086
}
60876087

6088-
// Header is valid/has work, merkle tree and segwit merkle tree are good...RELAY NOW
6089-
// (but if it does not build on our best tip, let the SendMessages loop relay it)
6090-
60916088
// Write block to history file
60926089
if (fNewBlock) *fNewBlock = true;
60936090
try {
@@ -6112,6 +6109,11 @@ bool ChainstateManager::AcceptBlock(const std::shared_ptr<const CBlock>& pblock,
61126109

61136110
CheckBlockIndex();
61146111

6112+
// Header is valid/has work, merkle tree and segwit merkle tree are good...RELAY NOW
6113+
// (but if it does not build on our best tip, let the SendMessages loop relay it)
6114+
if (!IsInitialBlockDownload() && ActiveTip() == pindex->pprev)
6115+
GetMainSignals().NewPoWValidBlock(pindex, pblock);
6116+
61156117
return true;
61166118
}
61176119

0 commit comments

Comments
 (0)