@@ -2010,7 +2010,7 @@ void PeerManagerImpl::BlockChecked(const CBlock& block, const BlockValidationSta
2010
2010
// the tip yet so we have no way to check this directly here. Instead we
2011
2011
// just check that there are currently no other blocks in flight.
2012
2012
else if (state.IsValid () &&
2013
- !m_chainman.ActiveChainstate (). IsInitialBlockDownload () &&
2013
+ !m_chainman.IsInitialBlockDownload () &&
2014
2014
mapBlocksInFlight.count (hash) == mapBlocksInFlight.size ()) {
2015
2015
if (it != mapBlockSource.end ()) {
2016
2016
MaybeSetPeerAsAnnouncingHeaderAndIDs (it->second .first );
@@ -2729,7 +2729,7 @@ void PeerManagerImpl::UpdatePeerStateForReceivedHeaders(CNode& pfrom, Peer& peer
2729
2729
2730
2730
// If we're in IBD, we want outbound peers that will serve us a useful
2731
2731
// chain. Disconnect peers that are on chains with insufficient work.
2732
- if (m_chainman.ActiveChainstate (). IsInitialBlockDownload () && !may_have_more_headers) {
2732
+ if (m_chainman.IsInitialBlockDownload () && !may_have_more_headers) {
2733
2733
// If the peer has no more headers to give us, then we know we have
2734
2734
// their tip.
2735
2735
if (nodestate->pindexBestKnownBlock && nodestate->pindexBestKnownBlock ->nChainWork < m_chainman.MinimumChainWork ()) {
@@ -3808,7 +3808,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3808
3808
LogPrint (BCLog::NET, " got inv: %s %s peer=%d\n " , inv.ToString (), fAlreadyHave ? " have" : " new" , pfrom.GetId ());
3809
3809
3810
3810
AddKnownTx (*peer, inv.hash );
3811
- if (!fAlreadyHave && !m_chainman.ActiveChainstate (). IsInitialBlockDownload ()) {
3811
+ if (!fAlreadyHave && !m_chainman.IsInitialBlockDownload ()) {
3812
3812
AddTxAnnouncement (pfrom, gtxid, current_time);
3813
3813
}
3814
3814
} else {
@@ -4080,7 +4080,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4080
4080
// Stop processing the transaction early if we are still in IBD since we don't
4081
4081
// have enough information to validate it yet. Sending unsolicited transactions
4082
4082
// is not considered a protocol violation, so don't punish the peer.
4083
- if (m_chainman.ActiveChainstate (). IsInitialBlockDownload ()) return ;
4083
+ if (m_chainman.IsInitialBlockDownload ()) return ;
4084
4084
4085
4085
CTransactionRef ptx;
4086
4086
vRecv >> ptx;
@@ -4284,7 +4284,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4284
4284
const CBlockIndex* prev_block = m_chainman.m_blockman .LookupBlockIndex (cmpctblock.header .hashPrevBlock );
4285
4285
if (!prev_block) {
4286
4286
// Doesn't connect (or is genesis), instead of DoSing in AcceptBlockHeader, request deeper headers
4287
- if (!m_chainman.ActiveChainstate (). IsInitialBlockDownload ()) {
4287
+ if (!m_chainman.IsInitialBlockDownload ()) {
4288
4288
MaybeSendGetHeaders (pfrom, GetLocator (m_chainman.m_best_header ), *peer);
4289
4289
}
4290
4290
return ;
@@ -5228,7 +5228,7 @@ void PeerManagerImpl::MaybeSendAddr(CNode& node, Peer& peer, std::chrono::micros
5228
5228
5229
5229
LOCK (peer.m_addr_send_times_mutex );
5230
5230
// Periodically advertise our local address to the peer.
5231
- if (fListen && !m_chainman.ActiveChainstate (). IsInitialBlockDownload () &&
5231
+ if (fListen && !m_chainman.IsInitialBlockDownload () &&
5232
5232
peer.m_next_local_addr_send < current_time) {
5233
5233
// If we've sent before, clear the bloom filter for the peer, so that our
5234
5234
// self-announcement will actually go out.
@@ -5323,7 +5323,7 @@ void PeerManagerImpl::MaybeSendFeefilter(CNode& pto, Peer& peer, std::chrono::mi
5323
5323
CAmount currentFilter = m_mempool.GetMinFee ().GetFeePerK ();
5324
5324
static FeeFilterRounder g_filter_rounder{CFeeRate{DEFAULT_MIN_RELAY_TX_FEE}};
5325
5325
5326
- if (m_chainman.ActiveChainstate (). IsInitialBlockDownload ()) {
5326
+ if (m_chainman.IsInitialBlockDownload ()) {
5327
5327
// Received tx-inv messages are discarded when the active
5328
5328
// chainstate is in IBD, so tell the peer to not send them.
5329
5329
currentFilter = MAX_MONEY;
@@ -5827,7 +5827,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
5827
5827
// Message: getdata (blocks)
5828
5828
//
5829
5829
std::vector<CInv> vGetData;
5830
- if (CanServeBlocks (*peer) && ((sync_blocks_and_headers_from_peer && !IsLimitedPeer (*peer)) || !m_chainman.ActiveChainstate (). IsInitialBlockDownload ()) && state.vBlocksInFlight .size () < MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
5830
+ if (CanServeBlocks (*peer) && ((sync_blocks_and_headers_from_peer && !IsLimitedPeer (*peer)) || !m_chainman.IsInitialBlockDownload ()) && state.vBlocksInFlight .size () < MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
5831
5831
std::vector<const CBlockIndex*> vToDownload;
5832
5832
NodeId staller = -1 ;
5833
5833
FindNextBlocksToDownload (*peer, MAX_BLOCKS_IN_TRANSIT_PER_PEER - state.vBlocksInFlight .size (), vToDownload, staller);
0 commit comments