Skip to content

Commit 3894104

Browse files
committed
Merge bitcoin/bitcoin#29361: refactor: Fix timedata includes
fad0faf refactor: Fix timedata includes (MarcoFalke) Pull request description: Remove unused includes. Also, fixup comments, see https://github.com/bitcoin/bitcoin/pull/28956/files#r1464827885. Also, add missing includes to `chain.h` while touching it. ACKs for top commit: achow101: ACK fad0faf dergoegge: utACK fad0faf stickies-v: ACK fad0faf Tree-SHA512: 45e86f2eb90f0e37012bd83bf30259719e0e58ede18b31f51ca8a6f6d23e6ca4d060fc0f56f821a711cbdb45792b82cf780f5ae3226680d7a966471990f352bc
2 parents 5b8c597 + fad0faf commit 3894104

File tree

10 files changed

+11
-12
lines changed

10 files changed

+11
-12
lines changed

src/chain.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,20 @@
1111
#include <flatfile.h>
1212
#include <kernel/cs_main.h>
1313
#include <primitives/block.h>
14+
#include <serialize.h>
1415
#include <sync.h>
1516
#include <uint256.h>
1617
#include <util/time.h>
1718

19+
#include <algorithm>
20+
#include <cassert>
21+
#include <cstdint>
22+
#include <string>
1823
#include <vector>
1924

2025
/**
2126
* Maximum amount of time that a block timestamp is allowed to exceed the
22-
* current network-adjusted time before the block will be accepted.
27+
* current time before the block will be accepted.
2328
*/
2429
static constexpr int64_t MAX_FUTURE_BLOCK_TIME = 2 * 60 * 60;
2530

src/headerssync.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#include <headerssync.h>
66
#include <logging.h>
77
#include <pow.h>
8-
#include <timedata.h>
98
#include <util/check.h>
9+
#include <util/time.h>
1010
#include <util/vector.h>
1111

1212
// The two constants below are computed using the simulation script in

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@
4141
#include <txrequest.h>
4242
#include <util/check.h>
4343
#include <util/strencodings.h>
44+
#include <util/time.h>
4445
#include <util/trace.h>
4546
#include <validation.h>
4647

4748
#include <algorithm>
4849
#include <atomic>
49-
#include <chrono>
5050
#include <future>
5151
#include <memory>
5252
#include <optional>

src/node/miner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include <policy/policy.h>
2121
#include <pow.h>
2222
#include <primitives/transaction.h>
23-
#include <timedata.h>
2423
#include <util/moneystr.h>
24+
#include <util/time.h>
2525
#include <validation.h>
2626

2727
#include <algorithm>

src/rpc/mining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
#include <script/descriptor.h>
2828
#include <script/script.h>
2929
#include <script/signingprovider.h>
30-
#include <timedata.h>
3130
#include <txmempool.h>
3231
#include <univalue.h>
3332
#include <util/strencodings.h>
3433
#include <util/string.h>
34+
#include <util/time.h>
3535
#include <util/translation.h>
3636
#include <validation.h>
3737
#include <validationinterface.h>

src/test/miner_tests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <policy/policy.h>
1313
#include <test/util/random.h>
1414
#include <test/util/txmempool.h>
15-
#include <timedata.h>
1615
#include <txmempool.h>
1716
#include <uint256.h>
1817
#include <util/strencodings.h>

src/test/util/setup_common.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#include <test/util/net.h>
4545
#include <test/util/random.h>
4646
#include <test/util/txmempool.h>
47-
#include <timedata.h>
4847
#include <txdb.h>
4948
#include <txmempool.h>
5049
#include <util/chaintype.h>

src/test/validation_chainstatemanager_tests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <test/util/random.h>
1616
#include <test/util/setup_common.h>
1717
#include <test/util/validation.h>
18-
#include <timedata.h>
1918
#include <uint256.h>
2019
#include <validation.h>
2120
#include <validationinterface.h>

src/timedata.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
#ifndef BITCOIN_TIMEDATA_H
66
#define BITCOIN_TIMEDATA_H
77

8-
#include <util/time.h>
9-
108
#include <algorithm>
119
#include <cassert>
12-
#include <chrono>
1310
#include <cstdint>
1411
#include <vector>
1512

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2188,7 +2188,7 @@ bool Chainstate::ConnectBlock(const CBlock& block, BlockValidationState& state,
21882188
// Also, currently the rule against blocks more than 2 hours in the future
21892189
// is enforced in ContextualCheckBlockHeader(); we wouldn't want to
21902190
// re-enforce that rule here (at least until we make it impossible for
2191-
// m_adjusted_time_callback() to go backward).
2191+
// the clock to go backward).
21922192
if (!CheckBlock(block, state, params.GetConsensus(), !fJustCheck, !fJustCheck)) {
21932193
if (state.GetResult() == BlockValidationResult::BLOCK_MUTATED) {
21942194
// We don't write down blocks to disk if they may have been

0 commit comments

Comments
 (0)