mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-06 14:19:59 -05:00
ProcessBlock is sometimes called with pfrom==NULL
This commit is contained in:
parent
0d56f11ada
commit
73aa0421a7
1 changed files with 4 additions and 2 deletions
|
@ -1652,6 +1652,7 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock)
|
||||||
int64 deltaTime = pblock->GetBlockTime() - pcheckpoint->nTime;
|
int64 deltaTime = pblock->GetBlockTime() - pcheckpoint->nTime;
|
||||||
if (deltaTime < 0)
|
if (deltaTime < 0)
|
||||||
{
|
{
|
||||||
|
if (pfrom)
|
||||||
pfrom->Misbehaving(100);
|
pfrom->Misbehaving(100);
|
||||||
return error("ProcessBlock() : block with timestamp before last checkpoint");
|
return error("ProcessBlock() : block with timestamp before last checkpoint");
|
||||||
}
|
}
|
||||||
|
@ -1661,6 +1662,7 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock)
|
||||||
bnRequired.SetCompact(ComputeMinWork(pcheckpoint->nBits, deltaTime));
|
bnRequired.SetCompact(ComputeMinWork(pcheckpoint->nBits, deltaTime));
|
||||||
if (bnNewBlock > bnRequired)
|
if (bnNewBlock > bnRequired)
|
||||||
{
|
{
|
||||||
|
if (pfrom)
|
||||||
pfrom->Misbehaving(100);
|
pfrom->Misbehaving(100);
|
||||||
return error("ProcessBlock() : block with too little proof-of-work");
|
return error("ProcessBlock() : block with too little proof-of-work");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue