mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
[refactor] move notfound processing to txdownload
This commit is contained in:
parent
042a97ce7f
commit
3a41926d1b
4 changed files with 23 additions and 4 deletions
|
|
@ -5133,16 +5133,16 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
|||
if (msg_type == NetMsgType::NOTFOUND) {
|
||||
std::vector<CInv> vInv;
|
||||
vRecv >> vInv;
|
||||
std::vector<uint256> tx_invs;
|
||||
if (vInv.size() <= node::MAX_PEER_TX_ANNOUNCEMENTS + MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
|
||||
LOCK(m_tx_download_mutex);
|
||||
for (CInv &inv : vInv) {
|
||||
if (inv.IsGenTxMsg()) {
|
||||
// If we receive a NOTFOUND message for a tx we requested, mark the announcement for it as
|
||||
// completed in TxRequestTracker.
|
||||
m_txdownloadman.GetTxRequestRef().ReceivedResponse(pfrom.GetId(), inv.hash);
|
||||
tx_invs.emplace_back(inv.hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
LOCK(m_tx_download_mutex);
|
||||
m_txdownloadman.ReceivedNotFound(pfrom.GetId(), tx_invs);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue