Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <timedata.h>
#include <netaddress.h>
#include <sync.h>
#include <ui_interface.h>
#include <util.h>
#include <utilstrencodings.h>
#include <warnings.h>
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 |
Definition at line 40 of file timedata.cpp.
Referenced by AddTimeData().
◆ AddTimeData()
void AddTimeData | ( | const CNetAddr & | ip, |
int64_t | nOffsetSample | ||
) |
Definition at line 47 of file timedata.cpp.
References _(), abs64(), BITCOIN_TIMEDATA_MAX_SAMPLES, cs_nTimeOffset, DEFAULT_MAX_TIME_ADJUSTMENT, gArgs, ArgsManager::GetArg(), CMedianFilter< T >::input(), LOCK, LogAcceptCategory(), LogPrint, CMedianFilter< T >::median(), CClientUIInterface::MSG_WARNING, BCLog::NET, nTimeOffset, SetMiscWarning(), CMedianFilter< T >::size(), CMedianFilter< T >::sorted(), strprintf, CClientUIInterface::ThreadSafeMessageBox, and uiInterface.
Referenced by ProcessMessage().
◆ 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
|
static |
Definition at line 19 of file timedata.cpp.
Referenced by AddTimeData(), and GetTimeOffset().
◆ nTimeOffset
|
static |
Definition at line 20 of file timedata.cpp.
Referenced by AddTimeData(), GUIUtil::formatTimeOffset(), GetTimeOffset(), and ProcessMessage().