[#CCoinsView]
= CCoinsView
:mrdocs:

Pure abstract view on the open txout dataset&period;

== Synopsis

Declared in `&lt;coins&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class CCoinsView;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:CCoinsView/2destructor.adoc[`&#126;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 &plus; BestBlock change)&period; The passed cursor is used to iterate through the coins&period;
| 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&period; May populate the cache&period; Use PeekCoin() to perform a non&hyphen;caching lookup&period;
| xref:CCoinsView/GetHeadBlocks.adoc[`GetHeadBlocks`]  [.small]#[virtual]#
| Retrieve the range of blocks that may have been only partially written&period; If the database is in a consistent state, the result is the empty vector&period; Otherwise, a two&hyphen;element vector is returned consisting of the new and the old block hash, in that order&period;
| xref:CCoinsView/HaveCoin.adoc[`HaveCoin`]  [.small]#[virtual]#
| Just check whether a given outpoint is unspent&period; May populate the cache&period; Use PeekCoin() to perform a non&hyphen;caching lookup&period;
| xref:CCoinsView/PeekCoin.adoc[`PeekCoin`]  [.small]#[virtual]#
| Retrieve the Coin (unspent transaction output) for a given outpoint, without caching results&period; Does not populate the cache&period; Use GetCoin() to cache the result&period;
|===


== 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&sol;)
| xref:CoinsViewEmpty.adoc[`CoinsViewEmpty`] 
| Noop coins view&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
