aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-02-20 22:35:08 +0100
committerLuke Dashjr <luke-jr+git@utopios.org>2012-02-27 12:58:53 -0500
commit1be5779124680ad6f411377f0a052f691855d2ec (patch)
treed04afb6b6769aeeb3ff01588417d3d6a65224568
parent001a64c71cb7f4090e953f49c32a6258e0d58767 (diff)
downloadbitcoin-1be5779124680ad6f411377f0a052f691855d2ec.tar.xz
ProcessBlock is sometimes called with pfrom==NULL
-rw-r--r--src/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 1f8abc04a2..e94c872fbe 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");
}
}