[#CCoinsViewDB]
= CCoinsViewDB
:mrdocs:

CCoinsView backed by the coin database (chainstate&sol;)

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class CCoinsViewDB final
    : public xref:CCoinsView.adoc[CCoinsView]
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:CCoinsView.adoc[CCoinsView]`
| Pure abstract view on the open txout dataset&period;
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:CCoinsViewDB/2constructor.adoc[`CCoinsViewDB`]         [.small]#[constructor]#
| Constructs the view, opening the coin database with the given parameters&period;
| xref:CCoinsViewDB/2destructor.adoc[`&#126;CCoinsViewDB`] [.small]#[destructor]# [.small]#[virtual]#
| Destroys the view and releases the underlying database&period;
| xref:CCoinsViewDB/BatchWrite.adoc[`BatchWrite`]  [.small]#[virtual]#
| Writes a batch of coin changes to the database&period;
| xref:CCoinsViewDB/CompactFullAsync.adoc[`CompactFullAsync`] 
| Perform a full compaction of the underlying LevelDB on a one&hyphen;shot background thread&period;
| xref:CCoinsViewDB/Cursor.adoc[`Cursor`] 
| Get a cursor to iterate over the whole state&period;
| xref:CCoinsViewDB/EstimateSize.adoc[`EstimateSize`]  [.small]#[virtual]#
| Returns an estimate of the database size in bytes&period;
| xref:CCoinsViewDB/GetBestBlock.adoc[`GetBestBlock`]  [.small]#[virtual]#
| Returns the hash of the best (tip) block recorded in the database&period;
| xref:CCoinsViewDB/GetCoin.adoc[`GetCoin`]  [.small]#[virtual]#
| Returns the coin for an outpoint, if present&period;
| xref:CCoinsViewDB/GetDBProperty.adoc[`GetDBProperty`] 
| Return an underlying LevelDB property value, if available&period;
| xref:CCoinsViewDB/GetHeadBlocks.adoc[`GetHeadBlocks`]  [.small]#[virtual]#
| Returns the head block hashes recorded during an interrupted flush&period;
| xref:CCoinsViewDB/HaveCoin.adoc[`HaveCoin`]  [.small]#[virtual]#
| Returns whether a coin exists for an outpoint&period;
| xref:CCoinsViewDB/NeedsUpgrade.adoc[`NeedsUpgrade`] 
| Whether an unsupported database format is used&period;
| xref:CCoinsViewDB/PeekCoin.adoc[`PeekCoin`]  [.small]#[virtual]#
| Returns the coin for an outpoint without caching the result&period;
| xref:CCoinsViewDB/ResizeCache.adoc[`ResizeCache`] 
| Dynamically alter the underlying leveldb cache size&period;
|===


== Protected Data Members

[cols="1,4"]
|===
| Name| Description
| xref:CCoinsViewDB/m_compaction.adoc[`m&lowbar;compaction`] 
| Shared future tracking an in&hyphen;progress background compaction&period;
| xref:CCoinsViewDB/m_db.adoc[`m&lowbar;db`] 
| The underlying coin database wrapper&period;
| xref:CCoinsViewDB/m_db_mutex.adoc[`m&lowbar;db&lowbar;mutex`] 
| Prevents CompactFull() from using m&lowbar;db while ResizeCache() replaces it&period;
| xref:CCoinsViewDB/m_db_params.adoc[`m&lowbar;db&lowbar;params`] 
| Parameters used to open the underlying database&period;
| xref:CCoinsViewDB/m_options.adoc[`m&lowbar;options`] 
| User&hyphen;controlled performance and debug options&period;
|===



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