Skip to content

Commit 145d94d

Browse files
committed
merge bitcoin#23636: Remove GetAdjustedTime from init.cpp
1 parent 150ca00 commit 145d94d

File tree

12 files changed

+35
-12
lines changed

12 files changed

+35
-12
lines changed

src/governance/governance.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <protocol.h>
2424
#include <shutdown.h>
2525
#include <spork.h>
26+
#include <timedata.h>
2627
#include <util/ranges.h>
2728
#include <util/time.h>
2829
#include <validation.h>

src/governance/vote.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <masternode/sync.h>
1313
#include <messagesigner.h>
1414
#include <net_processing.h>
15+
#include <timedata.h>
1516
#include <util/string.h>
1617
#include <util/system.h>
1718
#include <validation.h>

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2056,7 +2056,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
20562056

20572057
const CBlockIndex* tip = chainstate->m_chain.Tip();
20582058
RPCNotifyBlockChange(tip);
2059-
if (tip && tip->nTime > GetAdjustedTime() + 2 * 60 * 60) {
2059+
if (tip && tip->nTime > GetTime() + MAX_FUTURE_BLOCK_TIME) {
20602060
strLoadError = _("The block database contains a block which appears to be from the future. "
20612061
"This may be due to your computer's date and time being set incorrectly. "
20622062
"Only rebuild the block database if you are sure that your computer's date and time are correct");

src/net.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <netmessagemaker.h>
1313

1414
#include <addrdb.h>
15+
#include <addrman.h>
1516
#include <banman.h>
1617
#include <clientversion.h>
1718
#include <compat.h>

src/net.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#ifndef BITCOIN_NET_H
77
#define BITCOIN_NET_H
88

9-
#include <addrman.h>
109
#include <bip324.h>
1110
#include <bloom.h>
1211
#include <chainparams.h>
@@ -50,14 +49,15 @@
5049
#include <unordered_set>
5150
#include <vector>
5251

52+
class AddrMan;
53+
class BanMan;
5354
class CConnman;
5455
class CDeterministicMNList;
5556
class CDeterministicMNManager;
5657
class CMasternodeMetaMan;
5758
class CMasternodeSync;
58-
class CScheduler;
5959
class CNode;
60-
class BanMan;
60+
class CScheduler;
6161
struct bilingual_str;
6262

6363
/** Default for -whitelistrelay. */

src/rpc/governance.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <core_io.h>
77
#include <evo/deterministicmns.h>
88
#include <governance/classes.h>
9+
#include <governance/common.h>
910
#include <governance/governance.h>
1011
#include <governance/validators.h>
1112
#include <governance/vote.h>
@@ -19,7 +20,7 @@
1920
#include <rpc/server.h>
2021
#include <rpc/server_util.h>
2122
#include <rpc/util.h>
22-
#include <governance/common.h>
23+
#include <timedata.h>
2324
#include <util/strencodings.h>
2425
#include <util/system.h>
2526
#include <validation.h>

src/rpc/net.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <rpc/server.h>
77

8+
#include <addrman.h>
89
#include <banman.h>
910
#include <chainparams.h>
1011
#include <clientversion.h>

src/test/fuzz/connman.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5+
#include <addrman.h>
56
#include <chainparams.h>
67
#include <chainparamsbase.h>
78
#include <net.h>

src/test/fuzz/net.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5+
#include <addrman.h>
56
#include <chainparams.h>
67
#include <chainparamsbase.h>
78
#include <net.h>

test/functional/p2p_invalid_block.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
import copy
1616
import time
1717

18-
from test_framework.blocktools import create_block, create_coinbase, create_tx_with_script
18+
from test_framework.blocktools import MAX_FUTURE_BLOCK_TIME, create_block, create_coinbase, create_tx_with_script
1919
from test_framework.messages import COIN
2020
from test_framework.p2p import P2PDataStore
2121
from test_framework.test_framework import BitcoinTestFramework
2222
from test_framework.util import assert_equal
2323

24-
MAX_FUTURE_BLOCK_TIME = 2 * 60 * 60
25-
2624

2725
class InvalidBlockRequestTest(BitcoinTestFramework):
2826
def set_test_params(self):

0 commit comments

Comments
 (0)