From: Pieter Wuille Date: Mon, 20 Feb 2012 21:35:08 +0000 (+0100) Subject: ProcessBlock is sometimes called with pfrom==NULL X-Git-Tag: v0.4.0-unstable~129^2~1^2~18^2~10^2~19^2~3 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=1be5779124680ad6f411377f0a052f691855d2ec ProcessBlock is sometimes called with pfrom==NULL --- diff --git a/src/main.cpp b/src/main.cpp index 1f8abc0..e94c872 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1406,7 +1406,8 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock) int64 deltaTime = pblock->GetBlockTime() - pcheckpoint->nTime; if (deltaTime < 0) { - pfrom->Misbehaving(100); + if (pfrom) + pfrom->Misbehaving(100); return error("ProcessBlock() : block with timestamp before last checkpoint"); } CBigNum bnNewBlock; @@ -1415,7 +1416,8 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock) bnRequired.SetCompact(ComputeMinWork(pcheckpoint->nBits, deltaTime)); if (bnNewBlock > bnRequired) { - pfrom->Misbehaving(100); + if (pfrom) + pfrom->Misbehaving(100); return error("ProcessBlock() : block with too little proof-of-work"); } }