mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-05 19:38:54 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user