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:
Lőrinc
2026-02-20 14:19:58 +01:00
parent b637566c8d
commit 86296f276d
6 changed files with 34 additions and 32 deletions

View File

@@ -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));