diff options
| author | Pieter Wuille <[email protected]> | 2012-02-20 22:35:08 +0100 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2012-02-20 22:35:08 +0100 |
| commit | 73aa0421a73952ce13d731d8bbeabd2bb85d0bbf (patch) | |
| tree | 98c4a6e98b757f2d9833f90a09e03bccdb9b4103 /src/main.cpp | |
| parent | Fix tests after 38067c18 (diff) | |
| download | discoin-73aa0421a73952ce13d731d8bbeabd2bb85d0bbf.tar.xz discoin-73aa0421a73952ce13d731d8bbeabd2bb85d0bbf.zip | |
ProcessBlock is sometimes called with pfrom==NULL
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 b73037fb6..ca998ea8c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1652,7 +1652,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; @@ -1661,7 +1662,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"); } } |