[#CCoinsView] = CCoinsView :mrdocs: Pure abstract view on the open txout dataset. == Synopsis Declared in `<coins.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class CCoinsView; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:CCoinsView/2destructor.adoc[`~CCoinsView`] [.small]#[destructor]# [.small]#[virtual]# | As we use CCoinsViews polymorphically, have a virtual destructor | xref:CCoinsView/BatchWrite.adoc[`BatchWrite`] [.small]#[virtual]# | Do a bulk modification (multiple Coin changes + BestBlock change). The passed cursor is used to iterate through the coins. | xref:CCoinsView/EstimateSize.adoc[`EstimateSize`] [.small]#[virtual]# | Estimate database size | xref:CCoinsView/GetBestBlock.adoc[`GetBestBlock`] [.small]#[virtual]# | Retrieve the block hash whose state this CCoinsView currently represents | xref:CCoinsView/GetCoin.adoc[`GetCoin`] [.small]#[virtual]# | Retrieve the Coin (unspent transaction output) for a given outpoint. May populate the cache. Use PeekCoin() to perform a non‐caching lookup. | xref:CCoinsView/GetHeadBlocks.adoc[`GetHeadBlocks`] [.small]#[virtual]# | Retrieve the range of blocks that may have been only partially written. If the database is in a consistent state, the result is the empty vector. Otherwise, a two‐element vector is returned consisting of the new and the old block hash, in that order. | xref:CCoinsView/HaveCoin.adoc[`HaveCoin`] [.small]#[virtual]# | Just check whether a given outpoint is unspent. May populate the cache. Use PeekCoin() to perform a non‐caching lookup. | xref:CCoinsView/PeekCoin.adoc[`PeekCoin`] [.small]#[virtual]# | Retrieve the Coin (unspent transaction output) for a given outpoint, without caching results. Does not populate the cache. Use GetCoin() to cache the result. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:CCoinsViewBacked.adoc[`CCoinsViewBacked`] | CCoinsView backed by another CCoinsView | xref:CCoinsViewDB.adoc[`CCoinsViewDB`] | CCoinsView backed by the coin database (chainstate/) | xref:CoinsViewEmpty.adoc[`CoinsViewEmpty`] | Noop coins view. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#