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‐qt and non‐server tools.

Synopsis

Declared in <coins.h>

class CCoinsViewErrorCatcher final
    : public CCoinsViewBacked

Description

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

Base Classes

Name

Description

CCoinsViewBacked

CCoinsView backed by another CCoinsView

Member Functions

Name

Description

CCoinsViewErrorCatcher [constructor]

Construct the error catcher wrapping a backing view.

AddReadErrCallback

Register a callback to run when a LevelDB read error occurs.

BatchWrite [virtual]

Forward the bulk write to the backing view.

EstimateSize [virtual]

Forward the size estimate to the backing view.

GetBestBlock [virtual]

Forward the best‐block query to the backing view.

GetCoin [virtual]

Retrieve a coin, running the error callbacks on a read failure.

GetHeadBlocks [virtual]

Forward the head‐blocks query to the backing view.

HaveCoin [virtual]

Check whether an outpoint is unspent, running the error callbacks on a read failure.

PeekCoin [virtual]

Retrieve a coin without caching, running the error callbacks on a read failure.

SetBackend

Replace the backing view.

Protected Data Members

Name

Description

base

The underlying view that all calls are forwarded to.

Created with MrDocs