diff --git a/src/main.cpp b/src/main.cpp index bd626f319c..d40ef1d8bb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4881,12 +4881,15 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, else if (strCommand == "block" && !fImporting && !fReindex) // Ignore blocks received while importing { - TRY_LOCK(cs_main, lockMainBlock); - if(!lockMainBlock) return; - CBlock block; vRecv >> block; + TRY_LOCK(cs_main, lockMainBlock); + if(!lockMainBlock) { + LogPrintf("block -- failed to lock cs_main - %s\n", block.GetHash().ToString()); + return false; + } + CInv inv(MSG_BLOCK, block.GetHash()); LogPrint("net", "received block %s peer=%d\n", inv.hash.ToString(), pfrom->id); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index de75ca2e9f..d7b4427460 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -185,6 +185,7 @@ Value spork(const Array& params, bool fHelp) //broadcast new spork if(sporkManager.UpdateSpork(nSporkID, nValue)){ + ExecuteSpork(nSporkID, nValue); return "success"; } else { return "failure";