mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 04:12:36 -03:00
scripted-diff: rename GetSystemTimeInSeconds to GetTimeSeconds
-BEGIN VERIFY SCRIPT- sed -i -e 's/GetSystemTimeInSeconds/GetTimeSeconds/g' $(git grep -l GetSystemTimeInSeconds src) -END VERIFY SCRIPT-
This commit is contained in:
parent
d7a6bba949
commit
feb72e5432
6 changed files with 10 additions and 10 deletions
|
@ -418,7 +418,7 @@ private:
|
|||
if (conn_type == "addr-fetch") return "addr";
|
||||
return "";
|
||||
}
|
||||
const int64_t m_time_now{GetSystemTimeInSeconds()};
|
||||
const int64_t m_time_now{GetTimeSeconds()};
|
||||
|
||||
public:
|
||||
static constexpr int ID_PEERINFO = 0;
|
||||
|
|
|
@ -796,7 +796,7 @@ size_t CConnman::SocketSendData(CNode& node) const
|
|||
nBytes = send(node.hSocket, reinterpret_cast<const char*>(data.data()) + node.nSendOffset, data.size() - node.nSendOffset, MSG_NOSIGNAL | MSG_DONTWAIT);
|
||||
}
|
||||
if (nBytes > 0) {
|
||||
node.nLastSend = GetSystemTimeInSeconds();
|
||||
node.nLastSend = GetTimeSeconds();
|
||||
node.nSendBytes += nBytes;
|
||||
node.nSendOffset += nBytes;
|
||||
nSentSize += nBytes;
|
||||
|
@ -1251,7 +1251,7 @@ void CConnman::NotifyNumConnectionsChanged()
|
|||
|
||||
bool CConnman::ShouldRunInactivityChecks(const CNode& node, std::optional<int64_t> now_in) const
|
||||
{
|
||||
const int64_t now = now_in ? now_in.value() : GetSystemTimeInSeconds();
|
||||
const int64_t now = now_in ? now_in.value() : GetTimeSeconds();
|
||||
return node.nTimeConnected + m_peer_connect_timeout < now;
|
||||
}
|
||||
|
||||
|
@ -1259,7 +1259,7 @@ bool CConnman::InactivityCheck(const CNode& node) const
|
|||
{
|
||||
// Use non-mockable system time (otherwise these timers will pop when we
|
||||
// use setmocktime in the tests).
|
||||
int64_t now = GetSystemTimeInSeconds();
|
||||
int64_t now = GetTimeSeconds();
|
||||
|
||||
if (!ShouldRunInactivityChecks(node, now)) return false;
|
||||
|
||||
|
@ -2912,7 +2912,7 @@ ServiceFlags CConnman::GetLocalServices() const
|
|||
unsigned int CConnman::GetReceiveFloodSize() const { return nReceiveFloodSize; }
|
||||
|
||||
CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, SOCKET hSocketIn, const CAddress& addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress& addrBindIn, const std::string& addrNameIn, ConnectionType conn_type_in, bool inbound_onion)
|
||||
: nTimeConnected(GetSystemTimeInSeconds()),
|
||||
: nTimeConnected(GetTimeSeconds()),
|
||||
addr(addrIn),
|
||||
addrBind(addrBindIn),
|
||||
m_inbound_onion(inbound_onion),
|
||||
|
|
|
@ -1079,7 +1079,7 @@ void RPCConsole::updateDetailWidget()
|
|||
if (stats->nodeStats.m_bip152_highbandwidth_from) bip152_hb_settings += (bip152_hb_settings.isEmpty() ? ts.from : QLatin1Char('/') + ts.from);
|
||||
if (bip152_hb_settings.isEmpty()) bip152_hb_settings = ts.no;
|
||||
ui->peerHighBandwidth->setText(bip152_hb_settings);
|
||||
const int64_t time_now{GetSystemTimeInSeconds()};
|
||||
const int64_t time_now{GetTimeSeconds()};
|
||||
ui->peerConnTime->setText(GUIUtil::formatDurationStr(time_now - stats->nodeStats.nTimeConnected));
|
||||
ui->peerLastBlock->setText(TimeDurationField(time_now, stats->nodeStats.nLastBlockTime));
|
||||
ui->peerLastTx->setText(TimeDurationField(time_now, stats->nodeStats.nLastTXTime));
|
||||
|
|
|
@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE(util_FormatParseISO8601DateTime)
|
|||
BOOST_CHECK_EQUAL(ParseISO8601DateTime("1960-01-01T00:00:00Z"), 0);
|
||||
BOOST_CHECK_EQUAL(ParseISO8601DateTime("2011-09-30T23:36:17Z"), 1317425777);
|
||||
|
||||
auto time = GetSystemTimeInSeconds();
|
||||
auto time = GetTimeSeconds();
|
||||
BOOST_CHECK_EQUAL(ParseISO8601DateTime(FormatISO8601DateTime(time)), time);
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ int64_t GetTimeMicros()
|
|||
return int64_t{GetSystemTime<std::chrono::microseconds>().count()};
|
||||
}
|
||||
|
||||
int64_t GetSystemTimeInSeconds()
|
||||
int64_t GetTimeSeconds()
|
||||
{
|
||||
return int64_t{GetSystemTime<std::chrono::seconds>().count()};
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ inline double CountSecondsDouble(SecondsDouble t) { return t.count(); }
|
|||
|
||||
/**
|
||||
* DEPRECATED
|
||||
* Use either GetSystemTimeInSeconds (not mockable) or GetTime<T> (mockable)
|
||||
* Use either GetTimeSeconds (not mockable) or GetTime<T> (mockable)
|
||||
*/
|
||||
int64_t GetTime();
|
||||
|
||||
|
@ -48,7 +48,7 @@ int64_t GetTimeMillis();
|
|||
/** Returns the system time (not mockable) */
|
||||
int64_t GetTimeMicros();
|
||||
/** Returns the system time (not mockable) */
|
||||
int64_t GetSystemTimeInSeconds(); // Like GetTime(), but not mockable
|
||||
int64_t GetTimeSeconds(); // Like GetTime(), but not mockable
|
||||
|
||||
/**
|
||||
* DEPRECATED
|
||||
|
|
Loading…
Reference in a new issue