aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authordergoegge <n.goeggi@gmail.com>2024-06-19 09:57:22 +0100
committerdergoegge <n.goeggi@gmail.com>2024-06-19 10:14:31 +0100
commite009bf681c0e38a6451afa594ba3c7c8861f61c3 (patch)
tree8d387f3dbf4006cbbb1c2f15affd4a9190ec3382 /src/node
parent41544b8f96dbc9c6b8998acd6522200d67cdc16d (diff)
downloadbitcoin-e009bf681c0e38a6451afa594ba3c7c8861f61c3.tar.xz
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.
Diffstat (limited to 'src/node')
-rw-r--r--src/node/mini_miner.h2
1 files changed, 1 insertions, 1 deletions
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<typename I>
bool operator()(const I& a, const I& b) const
{
- return &(*a) < &(*b);
+ return a->first < b->first;
}
};