|
37 | 37 | #endif
|
38 | 38 |
|
39 | 39 | 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; |
41 | 40 |
|
42 | 41 | struct IteratorComparator
|
43 | 42 | {
|
@@ -74,6 +73,9 @@ static const int HISTORICAL_BLOCK_AGE = 7 * 24 * 60 * 60;
|
74 | 73 |
|
75 | 74 | // Internal stuff
|
76 | 75 | namespace {
|
| 76 | + /** Enable BIP61 (sending reject messages) */ |
| 77 | + bool g_enable_bip61 = DEFAULT_ENABLE_BIP61; |
| 78 | + |
77 | 79 | /** Number of nodes with fSyncStarted. */
|
78 | 80 | int nSyncStarted = 0;
|
79 | 81 |
|
@@ -811,6 +813,8 @@ static bool BlockRequestAllowed(const CBlockIndex* pindex, const Consensus::Para
|
811 | 813 | }
|
812 | 814 |
|
813 | 815 | 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 | + |
814 | 818 | // Initialize global variables that cannot be constructed at startup.
|
815 | 819 | recentRejects.reset(new CRollingBloomFilter(120000, 0.000001));
|
816 | 820 |
|
@@ -867,7 +871,7 @@ static uint256 most_recent_block_hash;
|
867 | 871 | static bool fWitnessesPresentInMostRecentCompactBlock;
|
868 | 872 |
|
869 | 873 | /**
|
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 |
871 | 875 | * to compatible peers.
|
872 | 876 | */
|
873 | 877 | 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:
|
912 | 916 | }
|
913 | 917 |
|
914 | 918 | /**
|
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 |
916 | 920 | * in chainActive to our peers.
|
917 | 921 | */
|
918 | 922 | void PeerLogicValidation::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {
|
@@ -948,7 +952,7 @@ void PeerLogicValidation::UpdatedBlockTip(const CBlockIndex *pindexNew, const CB
|
948 | 952 | }
|
949 | 953 |
|
950 | 954 | /**
|
951 |
| - * Handle invalid block rejection and consequent peer banning, maintain which |
| 955 | + * Handle invalid block rejection and consequent peer banning, maintain which |
952 | 956 | * peers announce compact blocks.
|
953 | 957 | */
|
954 | 958 | void PeerLogicValidation::BlockChecked(const CBlock& block, const CValidationState& state) {
|
|
0 commit comments