mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-02 11:55:42 +02:00
[cleanup] remove p2p_inv from AddTxAnnouncement
This param is no longer needed since orphan parent requests are added to the TxRequestTracker directly.
This commit is contained in:
@@ -39,9 +39,9 @@ void TxDownloadManager::DisconnectedPeer(NodeId nodeid)
|
||||
{
|
||||
m_impl->DisconnectedPeer(nodeid);
|
||||
}
|
||||
bool TxDownloadManager::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now, bool p2p_inv)
|
||||
bool TxDownloadManager::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now)
|
||||
{
|
||||
return m_impl->AddTxAnnouncement(peer, gtxid, now, p2p_inv);
|
||||
return m_impl->AddTxAnnouncement(peer, gtxid, now);
|
||||
}
|
||||
std::vector<GenTxid> TxDownloadManager::GetRequestsToSend(NodeId nodeid, std::chrono::microseconds current_time)
|
||||
{
|
||||
@@ -172,14 +172,13 @@ void TxDownloadManagerImpl::DisconnectedPeer(NodeId nodeid)
|
||||
|
||||
}
|
||||
|
||||
bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now, bool p2p_inv)
|
||||
bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now)
|
||||
{
|
||||
// If this is an orphan we are trying to resolve, consider this peer as a orphan resolution candidate instead.
|
||||
// - received as an p2p inv
|
||||
// - is wtxid matching something in orphanage
|
||||
// - exists in orphanage
|
||||
// - peer can be an orphan resolution candidate
|
||||
if (p2p_inv && gtxid.IsWtxid()) {
|
||||
if (gtxid.IsWtxid()) {
|
||||
if (auto orphan_tx{m_orphanage.GetTx(Wtxid::FromUint256(gtxid.GetHash()))}) {
|
||||
auto unique_parents{GetUniqueParents(*orphan_tx)};
|
||||
std::erase_if(unique_parents, [&](const auto& txid){
|
||||
@@ -205,7 +204,7 @@ bool TxDownloadManagerImpl::AddTxAnnouncement(NodeId peer, const GenTxid& gtxid,
|
||||
}
|
||||
|
||||
// If this is an inv received from a peer and we already have it, we can drop it.
|
||||
if (p2p_inv && AlreadyHaveTx(gtxid, /*include_reconsiderable=*/true)) return true;
|
||||
if (AlreadyHaveTx(gtxid, /*include_reconsiderable=*/true)) return true;
|
||||
|
||||
auto it = m_peer_info.find(peer);
|
||||
if (it == m_peer_info.end()) return false;
|
||||
|
||||
Reference in New Issue
Block a user