Skip to content

Commit

Permalink
[Spork] Do not accept sporks signed too far into the future
Browse files Browse the repository at this point in the history
  • Loading branch information
random-zebra committed Sep 23, 2019
1 parent 806f607 commit 5124b89
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/spork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ void CSporkManager::ProcessSpork(CNode* pfrom, std::string& strCommand, CDataStr
std::string strSpork = sporkManager.GetSporkNameByID(spork.nSporkID);
if (strSpork == "Unknown") return;

// Do not accept sporks signed way too far into the future
if (spork.nTimeSigned > GetAdjustedTime() + 2 * 60 * 60) {
LOCK(cs_main);
LogPrintf("%s -- ERROR: too far into the future\n", __func__);
Misbehaving(pfrom->GetId(), 100);
return;
}

uint256 hash = spork.GetHash();
{
LOCK(cs);
Expand Down

0 comments on commit 5124b89

Please sign in to comment.