From f2645aed1ba5f92a121bced412ea5cb22b1260ed Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Fri, 14 Jun 2019 01:53:17 +0800 Subject: [PATCH] better fix --- src/miner.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 312ee0a52..8ff4e2023 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -222,10 +222,13 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 boost::optional cheatSpend; uint256 cbHash; - + + boost::this_thread::interruption_point(); // exit thread before entering locks. + CBlockIndex* pindexPrev = 0; { - boost::this_thread::interruption_point(); // exit thread before entering locks. + // this should stop create block ever exiting until it has returned something. + boost::this_thread::disable_interruption(); ENTER_CRITICAL_SECTION(cs_main); ENTER_CRITICAL_SECTION(mempool.cs); pindexPrev = chainActive.LastTip();