Bitcoin ABC  0.26.3
P2P Digital Currency
Classes | Functions | Variables
timedata.h File Reference
#include <util/time.h>
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cstdint>
#include <vector>
Include dependency graph for timedata.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CMedianFilter< T >
 Median filter over a stream of values. More...
 

Functions

int64_t GetTimeOffset ()
 Functions to keep track of adjusted P2P time. More...
 
NodeClock::time_point GetAdjustedTime ()
 
NodeSeconds AdjustedTime ()
 
void AddTimeData (const CNetAddr &ip, int64_t nTime)
 
void TestOnlyResetTimeData ()
 Reset the internal state of GetTimeOffset(), GetAdjustedTime() and AddTimeData(). More...
 

Variables

static const int64_t DEFAULT_MAX_TIME_ADJUSTMENT = 70 * 60
 

Function Documentation

◆ AddTimeData()

void AddTimeData ( const CNetAddr ip,
int64_t  nTime 
)

Definition at line 44 of file timedata.cpp.

Here is the call graph for this function:

◆ AdjustedTime()

NodeSeconds AdjustedTime ( )
inline

Definition at line 70 of file timedata.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAdjustedTime()

NodeClock::time_point GetAdjustedTime ( )

Definition at line 34 of file timedata.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTimeOffset()

int64_t GetTimeOffset ( )

Functions to keep track of adjusted P2P time.

Functions to keep track of adjusted P2P time.

  • System clock
  • Median of other nodes clocks
  • The user (asking the user to fix the system clock if the first two disagree)

Definition at line 29 of file timedata.cpp.

Here is the caller graph for this function:

◆ TestOnlyResetTimeData()

void TestOnlyResetTimeData ( )

Reset the internal state of GetTimeOffset(), GetAdjustedTime() and AddTimeData().

Definition at line 126 of file timedata.cpp.

Variable Documentation

◆ DEFAULT_MAX_TIME_ADJUSTMENT

const int64_t DEFAULT_MAX_TIME_ADJUSTMENT = 70 * 60
static

Definition at line 16 of file timedata.h.