mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-21 12:18:13 +02:00
refactor: Return optional of Coin in GetCoin
Leaving the parameter as well for now. Co-authored-by: TheCharlatan <seb.kung@gmail.com>
This commit is contained in:
@@ -65,8 +65,10 @@ void CCoinsViewDB::ResizeCache(size_t new_cache_size)
|
||||
}
|
||||
}
|
||||
|
||||
bool CCoinsViewDB::GetCoin(const COutPoint &outpoint, Coin &coin) const {
|
||||
return m_db->Read(CoinEntry(&outpoint), coin);
|
||||
std::optional<Coin> CCoinsViewDB::GetCoin(const COutPoint& outpoint, Coin& coin) const
|
||||
{
|
||||
if (m_db->Read(CoinEntry(&outpoint), coin)) return coin;
|
||||
else return std::nullopt;
|
||||
}
|
||||
|
||||
bool CCoinsViewDB::HaveCoin(const COutPoint &outpoint) const {
|
||||
|
||||
Reference in New Issue
Block a user