mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-16 17:04:05 +02:00
coins: make CCoinsView methods pure virtual
`CCoinsView` provided default no-op implementations, which allowed constructing a bare view and silently getting dummy behavior. Make all interface methods pure virtual and remove the legacy default definitions from `coins.cpp` so callers must choose an explicit implementation. Move the virtual destructor to the beginning to avoid mixing it between the methods. No-op backing behavior remains available via `CoinsViewEmpty`.
This commit is contained in:
@@ -78,6 +78,11 @@ std::optional<Coin> CCoinsViewDB::GetCoin(const COutPoint& outpoint) const
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<Coin> CCoinsViewDB::PeekCoin(const COutPoint& outpoint) const
|
||||
{
|
||||
return GetCoin(outpoint);
|
||||
}
|
||||
|
||||
bool CCoinsViewDB::HaveCoin(const COutPoint& outpoint) const
|
||||
{
|
||||
return m_db->Exists(CoinEntry(&outpoint));
|
||||
|
||||
Reference in New Issue
Block a user