From e009bf681c0e38a6451afa594ba3c7c8861f61c3 Mon Sep 17 00:00:00 2001 From: dergoegge Date: Wed, 19 Jun 2024 09:57:22 +0100 Subject: Don't use iterator addresses in IteratorComparator The addresses of the iterator values are non-deterministic (i.e. they depend on where the values were allocated). This causes stability issues when fuzzing (e.g. in the `txorphan` and `mini_miner` harnesses), due the orders (derived from IteratorComparator) not being deterministic. Improve stability by comparing the first element in the iterator value pair instead of using the the value addresses. --- src/node/mini_miner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/node') diff --git a/src/node/mini_miner.h b/src/node/mini_miner.h index de62c0af75..aec2aaf6b6 100644 --- a/src/node/mini_miner.h +++ b/src/node/mini_miner.h @@ -63,7 +63,7 @@ struct IteratorComparator template bool operator()(const I& a, const I& b) const { - return &(*a) < &(*b); + return a->first < b->first; } }; -- cgit v1.2.3