From 8b7ca0ed32f9ecb7b137d95fec3182e38ec6f630 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Fri, 11 Jan 2019 23:24:12 +0800 Subject: [PATCH] Exit LOCK when return(0)! --- src/miner.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/miner.cpp b/src/miner.cpp index 7948fd0cd..cbefcbc41 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -547,6 +547,11 @@ CBlockTemplate* CreateNewBlock(const CScript& _scriptPubKeyIn, int32_t gpucount, if (scriptPubKeyIn.IsPayToScriptHash() || scriptPubKeyIn.IsPayToCryptoCondition()) { fprintf(stderr,"CreateNewBlock: attempt to add timelock to pay2sh or pay2cc\n"); + if ( ASSETCHAINS_SYMBOL[0] == 0 || (ASSETCHAINS_SYMBOL[0] != 0 && !isStake) ) + { + LEAVE_CRITICAL_SECTION(cs_main); + LEAVE_CRITICAL_SECTION(mempool.cs); + } return 0; } @@ -639,6 +644,11 @@ CBlockTemplate* CreateNewBlock(const CScript& _scriptPubKeyIn, int32_t gpucount, else { fprintf(stderr,"error adding notaryvin, need to create 0.0001 utxos\n"); + if ( ASSETCHAINS_SYMBOL[0] == 0 || (ASSETCHAINS_SYMBOL[0] != 0 && !isStake) ) + { + LEAVE_CRITICAL_SECTION(cs_main); + LEAVE_CRITICAL_SECTION(mempool.cs); + } return(0); } }