Skip to content

Commit 58e09f2

Browse files
committed
[p2p] don't log tx invs when in IBD
These invs are ignored anyway, and this allows us to more easily move the inv handling to TxDownloadManager in the next commit.
1 parent 2888653 commit 58e09f2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/net_processing.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4130,12 +4130,14 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
41304130
return;
41314131
}
41324132
const GenTxid gtxid = ToGenTxid(inv);
4133-
const bool fAlreadyHave = m_txdownloadman.AlreadyHaveTx(gtxid, /*include_reconsiderable=*/true);
4134-
LogDebug(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());
4135-
41364133
AddKnownTx(*peer, inv.hash);
4137-
if (!fAlreadyHave && !m_chainman.IsInitialBlockDownload()) {
4138-
AddTxAnnouncement(pfrom, gtxid, current_time);
4134+
4135+
if (!m_chainman.IsInitialBlockDownload()) {
4136+
const bool fAlreadyHave = m_txdownloadman.AlreadyHaveTx(gtxid, /*include_reconsiderable=*/true);
4137+
LogDebug(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());
4138+
if (!fAlreadyHave) {
4139+
AddTxAnnouncement(pfrom, gtxid, current_time);
4140+
}
41394141
}
41404142
} else {
41414143
LogDebug(BCLog::NET, "Unknown inv type \"%s\" received from peer=%d\n", inv.ToString(), pfrom.GetId());

0 commit comments

Comments
 (0)