diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp index 6396fce60ac..63024054fa6 100644 --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -48,11 +48,7 @@ public: std::optional GetCoin(const COutPoint& outpoint) const override { - if (auto it{map_.find(outpoint)}; it != map_.end()) { - if (!it->second.IsSpent() || m_rng.randbool()) { - return it->second; // TODO spent coins shouldn't be returned - } - } + if (auto it{map_.find(outpoint)}; it != map_.end() && !it->second.IsSpent()) return it->second; return std::nullopt; }