Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

timedata.cpp File Reference
#include <timedata.h>
#include <netaddress.h>
#include <sync.h>
#include <ui_interface.h>
#include <util.h>
#include <utilstrencodings.h>
#include <warnings.h>
+ Include dependency graph for timedata.cpp:

Go to the source code of this file.

Macros

#define BITCOIN_TIMEDATA_MAX_SAMPLES   200
 

Functions

int64_t GetTimeOffset ()
 "Never go to sea with two chronometers; take one or three." Our three time sources are: More...
 
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 45 of file timedata.cpp.

Referenced by AddTimeData().

Function Documentation

◆ abs64()

static int64_t abs64 ( int64_t  n)
static

Definition at line 40 of file timedata.cpp.

Referenced by AddTimeData().

◆ AddTimeData()

◆ GetAdjustedTime()

int64_t GetAdjustedTime ( )

Definition at line 35 of file timedata.cpp.

References GetTime(), and GetTimeOffset().

Referenced by CChainState::AcceptBlockHeader(), CWallet::AccountMove(), CAddrMan::Add_(), CGovernanceManager::AddCachedTriggers(), CGovernanceManager::AddGovernanceObject(), llmq::CLLMQUtils::AddQuorumProbeConnections(), CWallet::AddToWallet(), llmq::CRecoveredSigsDb::AddVoteTimeKeys(), AppInitMain(), llmq::CChainLocksHandler::BlockConnected(), CheckFinalTx(), CPrivateSendServer::CheckForCompleteQueue(), CGovernanceManager::CheckOrphanVotes(), CGovernanceManager::CheckPostponedObjects(), CGovernanceTriggerManager::CleanAndRemove(), CGovernanceManager::CleanOrphanObjects(), llmq::CSigSharesManager::Cleanup(), llmq::CRecoveredSigsDb::CleanupOldRecoveredSigs(), llmq::CRecoveredSigsDb::CleanupOldVotes(), llmq::CSigSharesManager::CollectSigSharesToRequest(), CPrivateSendServer::CommitFinalTransaction(), CConnman::ConnectNode(), BlockAssembler::CreateNewBlock(), CPrivateSendServer::CreateNewSession(), GetLocalAddress(), gobject_check(), CSporkManager::IsSporkActive(), CPrivateSendQueue::IsTimeOutOfBounds(), llmq::CChainLocksHandler::IsTxSafeForMining(), CGovernanceVote::IsValid(), CGovernanceManager::MasternodeRateCheck(), CMNAuth::ProcessMessage(), ProcessMessage(), llmq::CSigSharesManager::ProcessSigShare(), CSporkManager::ProcessSpork(), CGovernanceObject::ProcessVote(), CGovernanceManager::ProcessVote(), llmq::CDKGDebugManager::ResetLocalSessionStatus(), PeerLogicValidation::SendMessages(), TestBlockValidity(), CConnman::ThreadOpenConnections(), CConnman::ThreadOpenMasternodeConnections(), CMasternodeMetaInfo::ToJson(), llmq::CChainLocksHandler::TrySignChainTip(), CGovernanceManager::UpdateCachesAndClean(), CMasternodeSync::UpdatedBlockTip(), llmq::CDKGDebugManager::UpdateLocalMemberStatus(), llmq::CDKGDebugManager::UpdateLocalSessionStatus(), CGovernanceObject::UpdateSentinelVariables(), CSporkManager::UpdateSpork(), UpdateTime(), CProposalValidator::ValidateStartEndEpoch(), llmq::CDKGSession::VerifyConnectionAndMinProtoVersions(), llmq::CRecoveredSigsDb::WriteRecoveredSig(), and llmq::CRecoveredSigsDb::WriteVoteForId().

◆ GetTimeOffset()

int64_t GetTimeOffset ( )

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

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.

References cs_nTimeOffset, LOCK, and nTimeOffset.

Referenced by GetAdjustedTime(), and getnetworkinfo().

Variable Documentation

◆ cs_nTimeOffset

CCriticalSection cs_nTimeOffset
static

Definition at line 19 of file timedata.cpp.

Referenced by AddTimeData(), and GetTimeOffset().

◆ nTimeOffset

int64_t nTimeOffset = 0
static

Definition at line 20 of file timedata.cpp.

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

Released under the MIT license