From 917ab810d9380aa0c649847a647078b2f02d2643 Mon Sep 17 00:00:00 2001 From: glozow Date: Wed, 30 Oct 2024 21:13:01 -0400 Subject: [PATCH] [doc] comment fixups from n30110 --- src/node/txdownloadman.h | 3 ++- src/node/txdownloadman_impl.h | 4 +++- src/test/txdownload_tests.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/node/txdownloadman.h b/src/node/txdownloadman.h index 28ca90c554221..81b0c76e0a2fb 100644 --- a/src/node/txdownloadman.h +++ b/src/node/txdownloadman.h @@ -134,7 +134,8 @@ class TxDownloadManager { /** Deletes all txrequest announcements and orphans for a given peer. */ void DisconnectedPeer(NodeId nodeid); - /** New inv has been received. May be added as a candidate to txrequest. + /** Consider adding this tx hash to txrequest. Should be called whenever a new inv has been received. + * Also called internally when a transaction is missing parents so that we can request them. * @param[in] p2p_inv When true, only add this announcement if we don't already have the tx. * Returns true if this was a dropped inv (p2p_inv=true and we already have the tx), false otherwise. */ bool AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now, bool p2p_inv); diff --git a/src/node/txdownloadman_impl.h b/src/node/txdownloadman_impl.h index 48f02e607af94..8039ddb3cbbc9 100644 --- a/src/node/txdownloadman_impl.h +++ b/src/node/txdownloadman_impl.h @@ -160,7 +160,9 @@ class TxDownloadManagerImpl { void ConnectedPeer(NodeId nodeid, const TxDownloadConnectionInfo& info); void DisconnectedPeer(NodeId nodeid); - /** New inv has been received. May be added as a candidate to txrequest. */ + /** Consider adding this tx hash to txrequest. Should be called whenever a new inv has been received. + * Also called internally when a transaction is missing parents so that we can request them. + */ bool AddTxAnnouncement(NodeId peer, const GenTxid& gtxid, std::chrono::microseconds now, bool p2p_inv); /** Get getdata requests to send. */ diff --git a/src/test/txdownload_tests.cpp b/src/test/txdownload_tests.cpp index 3eb57a63537f2..e401fbf59c435 100644 --- a/src/test/txdownload_tests.cpp +++ b/src/test/txdownload_tests.cpp @@ -27,7 +27,7 @@ struct Behaviors { bool m_ignore_inv_txid; bool m_ignore_inv_wtxid; - // Constructor. We are passing and casting ints because they are more readable in a table (see all_expected_results). + // Constructor. We are passing and casting ints because they are more readable in a table (see expected_behaviors). Behaviors(bool txid_rejects, bool wtxid_rejects, bool txid_recon, bool wtxid_recon, bool keep, bool txid_inv, bool wtxid_inv) : m_txid_in_rejects(txid_rejects), m_wtxid_in_rejects(wtxid_rejects),