Skip to content

Commit 02bbc05

Browse files
committed
Rescope g_enable_bip61 to net_processing
1 parent 3f398d7 commit 02bbc05

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/init.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,8 +1134,6 @@ bool AppInitParameterInteraction()
11341134
if (gArgs.GetBoolArg("-peerbloomfilters", DEFAULT_PEERBLOOMFILTERS))
11351135
nLocalServices = ServiceFlags(nLocalServices | NODE_BLOOM);
11361136

1137-
g_enable_bip61 = gArgs.GetBoolArg("-enablebip61", DEFAULT_ENABLE_BIP61);
1138-
11391137
if (gArgs.GetArg("-rpcserialversion", DEFAULT_RPC_SERIALIZE_VERSION) < 0)
11401138
return InitError("rpcserialversion must be non-negative.");
11411139

src/net_processing.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#endif
3838

3939
std::atomic<int64_t> nTimeBestReceived(0); // Used only to inform the wallet of when we last received a block
40-
bool g_enable_bip61 = DEFAULT_ENABLE_BIP61;
4140

4241
struct IteratorComparator
4342
{
@@ -74,6 +73,9 @@ static const int HISTORICAL_BLOCK_AGE = 7 * 24 * 60 * 60;
7473

7574
// Internal stuff
7675
namespace {
76+
/** Enable BIP61 (sending reject messages) */
77+
bool g_enable_bip61 = DEFAULT_ENABLE_BIP61;
78+
7779
/** Number of nodes with fSyncStarted. */
7880
int nSyncStarted = 0;
7981

@@ -811,6 +813,8 @@ static bool BlockRequestAllowed(const CBlockIndex* pindex, const Consensus::Para
811813
}
812814

813815
PeerLogicValidation::PeerLogicValidation(CConnman* connmanIn, CScheduler &scheduler) : connman(connmanIn), m_stale_tip_check_time(0) {
816+
g_enable_bip61 = gArgs.GetBoolArg("-enablebip61", DEFAULT_ENABLE_BIP61);
817+
814818
// Initialize global variables that cannot be constructed at startup.
815819
recentRejects.reset(new CRollingBloomFilter(120000, 0.000001));
816820

@@ -867,7 +871,7 @@ static uint256 most_recent_block_hash;
867871
static bool fWitnessesPresentInMostRecentCompactBlock;
868872

869873
/**
870-
* Maintain state about the best-seen block and fast-announce a compact block
874+
* Maintain state about the best-seen block and fast-announce a compact block
871875
* to compatible peers.
872876
*/
873877
void PeerLogicValidation::NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& pblock) {
@@ -912,7 +916,7 @@ void PeerLogicValidation::NewPoWValidBlock(const CBlockIndex *pindex, const std:
912916
}
913917

914918
/**
915-
* Update our best height and announce any block hashes which weren't previously
919+
* Update our best height and announce any block hashes which weren't previously
916920
* in chainActive to our peers.
917921
*/
918922
void PeerLogicValidation::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {
@@ -948,7 +952,7 @@ void PeerLogicValidation::UpdatedBlockTip(const CBlockIndex *pindexNew, const CB
948952
}
949953

950954
/**
951-
* Handle invalid block rejection and consequent peer banning, maintain which
955+
* Handle invalid block rejection and consequent peer banning, maintain which
952956
* peers announce compact blocks.
953957
*/
954958
void PeerLogicValidation::BlockChecked(const CBlock& block, const CValidationState& state) {

src/net_processing.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ static constexpr int64_t MINIMUM_CONNECT_TIME = 30;
3737

3838
/** Default for BIP61 (sending reject messages) */
3939
static constexpr bool DEFAULT_ENABLE_BIP61 = true;
40-
/** Enable BIP61 (sending reject messages) */
41-
extern bool g_enable_bip61;
4240

4341
class PeerLogicValidation final : public CValidationInterface, public NetEventsInterface {
4442
private:

0 commit comments

Comments
 (0)