diff options
| author | Gavin Andresen <[email protected]> | 2012-02-22 11:25:08 -0500 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2012-02-22 11:25:08 -0500 |
| commit | 6fe8c45375f883813e646175d557ccbbf5b9926d (patch) | |
| tree | 62e54562cf4599d7b59d2409956e448e1e66e2b0 /src/main.cpp | |
| parent | Merge branch 'postfeb20' of https://github.com/sipa/bitcoin (diff) | |
| parent | ProcessBlock is sometimes called with pfrom==NULL (diff) | |
| download | discoin-6fe8c45375f883813e646175d557ccbbf5b9926d.tar.xz discoin-6fe8c45375f883813e646175d557ccbbf5b9926d.zip | |
Merge branch 'fixnullpfrom' of https://github.com/sipa/bitcoin
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 8103c8ad8..a9311e2ce 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1655,7 +1655,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; @@ -1664,7 +1665,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"); } } |