mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
[refactor] move peer (dis)connection logic to TxDownload
The information stored in TxDownloadConnectionInfo isn't used until the next commit.
This commit is contained in:
@@ -1686,8 +1686,7 @@ void PeerManagerImpl::FinalizeNode(const CNode& node)
|
||||
}
|
||||
{
|
||||
LOCK(m_tx_download_mutex);
|
||||
m_txdownloadman.GetOrphanageRef().EraseForPeer(nodeid);
|
||||
m_txdownloadman.GetTxRequestRef().DisconnectedPeer(nodeid);
|
||||
m_txdownloadman.DisconnectedPeer(nodeid);
|
||||
}
|
||||
if (m_txreconciliation) m_txreconciliation->ForgetPeer(nodeid);
|
||||
m_num_preferred_download_peers -= state->fPreferredDownload;
|
||||
@@ -3852,6 +3851,16 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
||||
tx_relay->m_next_inv_send_time == 0s));
|
||||
}
|
||||
|
||||
{
|
||||
LOCK2(::cs_main, m_tx_download_mutex);
|
||||
const CNodeState* state = State(pfrom.GetId());
|
||||
m_txdownloadman.ConnectedPeer(pfrom.GetId(), node::TxDownloadConnectionInfo {
|
||||
.m_preferred = state->fPreferredDownload,
|
||||
.m_relay_permissions = pfrom.HasPermission(NetPermissionFlags::Relay),
|
||||
.m_wtxid_relay = peer->m_wtxid_relay,
|
||||
});
|
||||
}
|
||||
|
||||
pfrom.fSuccessfullyConnected = true;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user