[#CCoinsViewErrorCatcher]
= CCoinsViewErrorCatcher
:mrdocs:

This is a minimally invasive approach to shutdown on LevelDB read errors from the chainstate, while keeping user interface out of the common library, which is shared between bitcoind, and bitcoin&hyphen;qt and non&hyphen;server tools&period;

== Synopsis

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

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

== Description

Writes do not need similar protection, as failure to write is handled by the caller&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:CCoinsViewBacked.adoc[CCoinsViewBacked]`
| CCoinsView backed by another CCoinsView
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:CCoinsViewErrorCatcher/2constructor.adoc[`CCoinsViewErrorCatcher`]         [.small]#[constructor]#
| Construct the error catcher wrapping a backing view&period;
| xref:CCoinsViewErrorCatcher/AddReadErrCallback.adoc[`AddReadErrCallback`] 
| Register a callback to run when a LevelDB read error occurs&period;
| xref:CCoinsViewBacked/BatchWrite.adoc[`BatchWrite`]  [.small]#[virtual]#
| Forward the bulk write to the backing view&period;
| xref:CCoinsViewBacked/EstimateSize.adoc[`EstimateSize`]  [.small]#[virtual]#
| Forward the size estimate to the backing view&period;
| xref:CCoinsViewBacked/GetBestBlock.adoc[`GetBestBlock`]  [.small]#[virtual]#
| Forward the best&hyphen;block query to the backing view&period;
| xref:CCoinsViewErrorCatcher/GetCoin.adoc[`GetCoin`]  [.small]#[virtual]#
| Retrieve a coin, running the error callbacks on a read failure&period;
| xref:CCoinsViewBacked/GetHeadBlocks.adoc[`GetHeadBlocks`]  [.small]#[virtual]#
| Forward the head&hyphen;blocks query to the backing view&period;
| xref:CCoinsViewErrorCatcher/HaveCoin.adoc[`HaveCoin`]  [.small]#[virtual]#
| Check whether an outpoint is unspent, running the error callbacks on a read failure&period;
| xref:CCoinsViewErrorCatcher/PeekCoin.adoc[`PeekCoin`]  [.small]#[virtual]#
| Retrieve a coin without caching, running the error callbacks on a read failure&period;
| xref:CCoinsViewBacked/SetBackend.adoc[`SetBackend`] 
| Replace the backing view&period;
|===


== Protected Data Members

[cols="1,4"]
|===
| Name| Description
| xref:CCoinsViewBacked/base.adoc[`base`] 
| The underlying view that all calls are forwarded to&period;
|===



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