This commit is contained in:
Evan Duffield 2015-08-01 02:03:15 -07:00
parent 171c0b145a
commit 64aad03485
2 changed files with 7 additions and 3 deletions

View File

@ -4881,12 +4881,15 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
else if (strCommand == "block" && !fImporting && !fReindex) // Ignore blocks received while importing else if (strCommand == "block" && !fImporting && !fReindex) // Ignore blocks received while importing
{ {
TRY_LOCK(cs_main, lockMainBlock);
if(!lockMainBlock) return;
CBlock block; CBlock block;
vRecv >> 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()); CInv inv(MSG_BLOCK, block.GetHash());
LogPrint("net", "received block %s peer=%d\n", inv.hash.ToString(), pfrom->id); LogPrint("net", "received block %s peer=%d\n", inv.hash.ToString(), pfrom->id);

View File

@ -185,6 +185,7 @@ Value spork(const Array& params, bool fHelp)
//broadcast new spork //broadcast new spork
if(sporkManager.UpdateSpork(nSporkID, nValue)){ if(sporkManager.UpdateSpork(nSporkID, nValue)){
ExecuteSpork(nSporkID, nValue);
return "success"; return "success";
} else { } else {
return "failure"; return "failure";