Dash Core  0.12.2.1
P2P Digital Currency
timedata.cpp File Reference
#include "timedata.h"
#include "netaddress.h"
#include "sync.h"
#include "ui_interface.h"
#include "util.h"
#include "utilstrencodings.h"
#include <boost/foreach.hpp>

Go to the source code of this file.

Macros

#define BITCOIN_TIMEDATA_MAX_SAMPLES   200
 

Functions

int64_t GetTimeOffset ()
 
int64_t GetAdjustedTime ()
 
static int64_t abs64 (int64_t n)
 
void AddTimeData (const CNetAddr &ip, int64_t nOffsetSample)
 

Variables

static CCriticalSection cs_nTimeOffset
 
static int64_t nTimeOffset = 0
 

Macro Definition Documentation

◆ BITCOIN_TIMEDATA_MAX_SAMPLES

#define BITCOIN_TIMEDATA_MAX_SAMPLES   200

Definition at line 43 of file timedata.cpp.

Referenced by AddTimeData().

Function Documentation

◆ abs64()

static int64_t abs64 ( int64_t  n)
static

Definition at line 38 of file timedata.cpp.

Referenced by AddTimeData().

◆ AddTimeData()

void AddTimeData ( const CNetAddr ip,
int64_t  nOffsetSample 
)

Definition at line 45 of file timedata.cpp.

Referenced by ProcessMessage().

◆ GetAdjustedTime()

int64_t GetAdjustedTime ( )

Definition at line 33 of file timedata.cpp.

Referenced by CAddrMan::Add_(), CGovernanceManager::AddGovernanceObject(), CGovernanceManager::AddOrphanVote(), CWallet::AddToWallet(), AppInit2(), CMasternode::Check(), CheckBlockHeader(), CheckFinalTx(), CPrivateSendServer::CheckForCompleteQueue(), CGovernanceManager::CheckMasternodeOrphanObjects(), CMasternodeMan::CheckMnbAndUpdateMasternodeList(), CGovernanceObject::CheckOrphanVotes(), CGovernanceManager::CheckOrphanVotes(), CGovernanceManager::CheckPostponedObjects(), CGovernanceTriggerManager::CleanAndRemove(), CGovernanceManager::CleanOrphanObjects(), CMasternode::CMasternode(), CMasternodePing::CMasternodePing(), CPrivateSendServer::CommitFinalTransaction(), CConnman::ConnectNode(), CreateNewBlock(), CPrivateSendServer::CreateNewSession(), TransactionDesc::FormatTxStatus(), GetLocalAddress(), CMasternodeMan::GetNextMasternodeInQueueForPayment(), gobject(), CMasternode::IsBroadcastedWithin(), CMasternodePing::IsExpired(), CDarksendQueue::IsExpired(), CAlert::IsInEffect(), CMasternode::IsPingedWithin(), CSporkManager::IsSporkActive(), CGovernanceVote::IsValid(), CGovernanceManager::MasternodeRateCheck(), movecmd(), CGovernanceManager::ProcessMessage(), ProcessMessage(), CGovernanceObject::ProcessVote(), CGovernanceManager::ProcessVote(), CAlert::RelayTo(), CActiveMasternode::SendMasternodePing(), SendMessages(), CMasternodePing::Sign(), CMasternodeBroadcast::Sign(), CMasternodePing::SimpleCheck(), CMasternodeBroadcast::SimpleCheck(), CConnman::ThreadOpenConnections(), ThreadSendAlert(), CGovernanceManager::UpdateCachesAndClean(), CGovernanceManager::UpdateCurrentWatchdog(), CActiveMasternode::UpdateSentinelPing(), CGovernanceObject::UpdateSentinelVariables(), CSporkManager::UpdateSpork(), TransactionRecord::updateStatus(), UpdateTime(), and CMasternode::UpdateWatchdogVoteTime().

◆ GetTimeOffset()

int64_t GetTimeOffset ( )

"Never go to sea with two chronometers; take one or three." Our three time sources are:

  • 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 27 of file timedata.cpp.

Referenced by GetAdjustedTime(), getinfo(), and getnetworkinfo().

Variable Documentation

◆ cs_nTimeOffset

CCriticalSection cs_nTimeOffset
static

Definition at line 17 of file timedata.cpp.

Referenced by AddTimeData(), and GetTimeOffset().

◆ nTimeOffset

int64_t nTimeOffset = 0
static

Definition at line 18 of file timedata.cpp.

Referenced by AddTimeData(), GUIUtil::formatTimeOffset(), GetTimeOffset(), and ProcessMessage().