aboutsummaryrefslogtreecommitdiff
path: root/src/txrequest.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2020-09-29 16:10:16 -0700
committerPieter Wuille <pieter@wuille.net>2020-10-12 12:08:43 -0700
commit3c7fe0e5a0ee1abf4dc263ae5310e68253c866e1 (patch)
tree5dfc0534e5f8f7d5600e448f901ef72f78dbd32c /src/txrequest.h
parentda3b8fde03f2e8060bb7ff3bff17175dab85f0cd (diff)
Add txrequest unit tests
Add unit tests for TxRequestTracker. Several scenarios are tested, randomly interleaved with eachother. Includes a test by Antoine Riard (ariard).
Diffstat (limited to 'src/txrequest.h')
-rw-r--r--src/txrequest.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/txrequest.h b/src/txrequest.h
index e24390b6aa..a434901a52 100644
--- a/src/txrequest.h
+++ b/src/txrequest.h
@@ -192,6 +192,18 @@ public:
/** Count how many announcements are being tracked in total across all peers and transaction hashes. */
size_t Size() const;
+
+ /** Access to the internal priority computation (testing only) */
+ uint64_t ComputePriority(const uint256& txhash, NodeId peer, bool preferred) const;
+
+ /** Run internal consistency check (testing only). */
+ void SanityCheck() const;
+
+ /** Run a time-dependent internal consistency check (testing only).
+ *
+ * This can only be called immediately after GetRequestable, with the same 'now' parameter.
+ */
+ void PostGetRequestableSanityCheck(std::chrono::microseconds now) const;
};
#endif // BITCOIN_TXREQUEST_H