aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/fuzz')
-rw-r--r--src/test/fuzz/txrequest.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/fuzz/txrequest.cpp b/src/test/fuzz/txrequest.cpp
index 4a8e32d105..9529ad3274 100644
--- a/src/test/fuzz/txrequest.cpp
+++ b/src/test/fuzz/txrequest.cpp
@@ -246,11 +246,13 @@ public:
//! list of (sequence number, txhash, is_wtxid) tuples.
std::vector<std::tuple<uint64_t, int, bool>> result;
+ std::vector<std::pair<NodeId, GenTxid>> expected_expired;
for (int txhash = 0; txhash < MAX_TXHASHES; ++txhash) {
// Mark any expired REQUESTED announcements as COMPLETED.
for (int peer2 = 0; peer2 < MAX_PEERS; ++peer2) {
Announcement& ann2 = m_announcements[txhash][peer2];
if (ann2.m_state == State::REQUESTED && ann2.m_time <= m_now) {
+ expected_expired.emplace_back(peer2, GenTxid{ann2.m_is_wtxid, TXHASHES[txhash]});
ann2.m_state = State::COMPLETED;
break;
}
@@ -265,9 +267,13 @@ public:
}
// Sort the results by sequence number.
std::sort(result.begin(), result.end());
+ std::sort(expected_expired.begin(), expected_expired.end());
// Compare with TxRequestTracker's implementation.
- const auto actual = m_tracker.GetRequestable(peer, m_now);
+ std::vector<std::pair<NodeId, GenTxid>> expired;
+ const auto actual = m_tracker.GetRequestable(peer, m_now, &expired);
+ std::sort(expired.begin(), expired.end());
+ assert(expired == expected_expired);
m_tracker.PostGetRequestableSanityCheck(m_now);
assert(result.size() == actual.size());