Skip to content

Commit c6be144

Browse files
committed
Remove timedata
With the introduction and usage of TimeOffsets, there is no more need for this file. Remove it.
1 parent 92e72b5 commit c6be144

11 files changed

+1
-351
lines changed

src/Makefile.am

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ BITCOIN_CORE_H = \
284284
support/lockedpool.h \
285285
sync.h \
286286
threadsafety.h \
287-
timedata.h \
288287
torcontrol.h \
289288
txdb.h \
290289
txmempool.h \
@@ -464,7 +463,6 @@ libbitcoin_node_a_SOURCES = \
464463
rpc/txoutproof.cpp \
465464
script/sigcache.cpp \
466465
signet.cpp \
467-
timedata.cpp \
468466
torcontrol.cpp \
469467
txdb.cpp \
470468
txmempool.cpp \

src/Makefile.test.include

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ BITCOIN_TESTS =\
151151
test/streams_tests.cpp \
152152
test/sync_tests.cpp \
153153
test/system_tests.cpp \
154-
test/timedata_tests.cpp \
155154
test/timeoffsets_tests.cpp \
156155
test/torcontrol_tests.cpp \
157156
test/transaction_tests.cpp \
@@ -382,7 +381,6 @@ test_fuzz_fuzz_SOURCES = \
382381
test/fuzz/string.cpp \
383382
test/fuzz/strprintf.cpp \
384383
test/fuzz/system.cpp \
385-
test/fuzz/timedata.cpp \
386384
test/fuzz/timeoffsets.cpp \
387385
test/fuzz/torcontrol.cpp \
388386
test/fuzz/transaction.cpp \

src/addrman_impl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <protocol.h>
1212
#include <serialize.h>
1313
#include <sync.h>
14-
#include <timedata.h>
1514
#include <uint256.h>
1615
#include <util/time.h>
1716

src/init.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
#include <scheduler.h>
6868
#include <script/sigcache.h>
6969
#include <sync.h>
70-
#include <timedata.h>
7170
#include <torcontrol.h>
7271
#include <txdb.h>
7372
#include <txmempool.h>
@@ -523,7 +522,6 @@ void SetupServerArgs(ArgsManager& argsman)
523522
argsman.AddArg("-maxconnections=<n>", strprintf("Maintain at most <n> automatic connections to peers (default: %u). This limit does not apply to connections manually added via -addnode or the addnode RPC, which have a separate limit of %u.", DEFAULT_MAX_PEER_CONNECTIONS, MAX_ADDNODE_CONNECTIONS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
524523
argsman.AddArg("-maxreceivebuffer=<n>", strprintf("Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)", DEFAULT_MAXRECEIVEBUFFER), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
525524
argsman.AddArg("-maxsendbuffer=<n>", strprintf("Maximum per-connection memory usage for the send buffer, <n>*1000 bytes (default: %u)", DEFAULT_MAXSENDBUFFER), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
526-
argsman.AddArg("-maxtimeadjustment", strprintf("Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by outbound peers forward or backward by this amount (default: %u seconds).", DEFAULT_MAX_TIME_ADJUSTMENT), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
527525
argsman.AddArg("-maxuploadtarget=<n>", strprintf("Tries to keep outbound traffic under the given target per 24h. Limit does not apply to peers with 'download' permission or blocks created within past week. 0 = no limit (default: %s). Optional suffix units [k|K|m|M|g|G|t|T] (default: M). Lowercase is 1000 base while uppercase is 1024 base", DEFAULT_MAX_UPLOAD_TARGET), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
528526
#if HAVE_SOCKADDR_UN
529527
argsman.AddArg("-onion=<ip:port|path>", "Use separate SOCKS5 proxy to reach peers via Tor onion services, set -noonion to disable (default: -proxy). May be a local file path prefixed with 'unix:'.", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);

src/net_processing.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include <scheduler.h>
3636
#include <streams.h>
3737
#include <sync.h>
38-
#include <timedata.h>
3938
#include <tinyformat.h>
4039
#include <txmempool.h>
4140
#include <txorphanage.h>
@@ -3684,9 +3683,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
36843683

36853684
peer->m_time_offset = NodeSeconds{std::chrono::seconds{nTime}} - Now<NodeSeconds>();
36863685
if (!pfrom.IsInboundConn()) {
3687-
// Don't use time offset samples from inbound peers to make it
3686+
// Don't use timedata samples from inbound peers to make it
36883687
// harder for others to create false warnings about our clock being out of sync.
3689-
AddTimeData(pfrom.addr, Ticks<std::chrono::seconds>(peer->m_time_offset.load()));
36903688
m_outbound_time_offsets.Add(peer->m_time_offset);
36913689
m_outbound_time_offsets.WarnIfOutOfSync();
36923690
}

src/test/denialofservice_tests.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <test/util/net.h>
1717
#include <test/util/random.h>
1818
#include <test/util/setup_common.h>
19-
#include <timedata.h>
2019
#include <util/string.h>
2120
#include <util/time.h>
2221
#include <validation.h>
@@ -72,7 +71,6 @@ BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction)
7271
/*local_services=*/ServiceFlags(NODE_NETWORK | NODE_WITNESS),
7372
/*version=*/PROTOCOL_VERSION,
7473
/*relay_txs=*/true);
75-
TestOnlyResetTimeData();
7674

7775
// This test requires that we have a chain with non-zero work.
7876
{

src/test/fuzz/timedata.cpp

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/test/net_tests.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <test/util/random.h>
2020
#include <test/util/setup_common.h>
2121
#include <test/util/validation.h>
22-
#include <timedata.h>
2322
#include <util/strencodings.h>
2423
#include <util/string.h>
2524
#include <validation.h>
@@ -902,10 +901,6 @@ BOOST_AUTO_TEST_CASE(initial_advertise_from_version_message)
902901
chainman.ResetIbd();
903902
m_node.args->ForceSetArg("-capturemessages", "0");
904903
m_node.args->ForceSetArg("-bind", "");
905-
// PeerManager::ProcessMessage() calls AddTimeData() which changes the internal state
906-
// in timedata.cpp and later confuses the test "timedata_tests/addtimedata". Thus reset
907-
// that state as it was before our test was run.
908-
TestOnlyResetTimeData();
909904
}
910905

911906

src/test/timedata_tests.cpp

Lines changed: 0 additions & 105 deletions
This file was deleted.

src/timedata.cpp

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)