mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Add txrequest unit tests
Add unit tests for TxRequestTracker. Several scenarios are tested, randomly interleaved with eachother. Includes a test by Antoine Riard (ariard).
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user