wallet: ensure COutput added in set are unique

before #25806, set<COutput> was used and would not
contain same COutputs in the set.

now we use set<shared_ptr<COutput>> and it might be
possible for 2 distinct shared_ptr (different pointer
address but same COutputs) to be added into the set.

so preserve previous behaviour by making sure values
in the set are also distinct
This commit is contained in:
stratospher
2026-01-27 12:47:06 +05:30
parent fefa3be782
commit 7072d825e3
7 changed files with 24 additions and 14 deletions

View File

@@ -19,6 +19,11 @@ inline void insert(std::set<TsetT>& dst, const Tsrc& src) {
dst.insert(src.begin(), src.end());
}
template <typename TsetT, typename Compare, typename Tsrc>
inline void insert(std::set<TsetT, Compare>& dst, const Tsrc& src) {
dst.insert(src.begin(), src.end());
}
} // namespace util
#endif // BITCOIN_UTIL_INSERT_H