aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2024-10-30 21:13:01 -0400
committerglozow <gloriajzhao@gmail.com>2024-10-30 21:13:01 -0400
commit917ab810d9380aa0c649847a647078b2f02d2643 (patch)
treea4cdea66a0dbc4aeb481da4877ba7265b8aad221 /src
parentf07a533dfcb172321972e5afb3b38a4bd24edb87 (diff)
[doc] comment fixups from n30110
Diffstat (limited to 'src')
-rw-r--r--src/node/txdownloadman.h3
-rw-r--r--src/node/txdownloadman_impl.h4
-rw-r--r--src/test/txdownload_tests.cpp2
3 files changed, 6 insertions, 3 deletions
diff --git a/src/node/txdownloadman.h b/src/node/txdownloadman.h
index 28ca90c554..81b0c76e0a 100644
--- a/src/node/txdownloadman.h
+++ b/src/node/txdownloadman.h
@@ -134,7 +134,8 @@ public:
/** 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 48f02e607a..8039ddb3cb 100644
--- a/src/node/txdownloadman_impl.h
+++ b/src/node/txdownloadman_impl.h
@@ -160,7 +160,9 @@ public:
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 3eb57a6353..e401fbf59c 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),