mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Merge pull request #517 from gavinandresen/DoSprevention
Denial-of-service prevention
This commit is contained in:
@@ -813,11 +813,20 @@ void ShrinkDebugFile()
|
||||
// - Median of other nodes's clocks
|
||||
// - The user (asking the user to fix the system clock if the first two disagree)
|
||||
//
|
||||
static int64 nMockTime = 0; // For unit testing
|
||||
|
||||
int64 GetTime()
|
||||
{
|
||||
if (nMockTime) return nMockTime;
|
||||
|
||||
return time(NULL);
|
||||
}
|
||||
|
||||
void SetMockTime(int64 nMockTimeIn)
|
||||
{
|
||||
nMockTime = nMockTimeIn;
|
||||
}
|
||||
|
||||
static int64 nTimeOffset = 0;
|
||||
|
||||
int64 GetAdjustedTime()
|
||||
|
||||
Reference in New Issue
Block a user