Skip to content

Commit

Permalink
Do not accept sporks with nTimeSigned way too far into the future (#2578
Browse files Browse the repository at this point in the history
)
  • Loading branch information
UdjinM6 authored Dec 22, 2018
1 parent 587911b commit 33f78d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/spork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ void CSporkManager::ProcessSpork(CNode* pfrom, const std::string& strCommand, CD
strLogMsg = strprintf("SPORK -- hash: %s id: %d value: %10d bestHeight: %d peer=%d", hash.ToString(), spork.nSporkID, spork.nValue, chainActive.Height(), pfrom->id);
}

if (spork.nTimeSigned > GetAdjustedTime() + 2 * 60 * 60) {
LOCK(cs_main);
LogPrintf("CSporkManager::ProcessSpork -- ERROR: too far into the future\n");
Misbehaving(pfrom->GetId(), 100);
return;
}

CKeyID keyIDSigner;
bool fSpork6IsActive = IsSporkActive(SPORK_6_NEW_SIGS);
if (!spork.GetSignerKeyID(keyIDSigner, fSpork6IsActive)
Expand Down

0 comments on commit 33f78d7

Please sign in to comment.