Bitcoin Core 31.99.0
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
CoinsViewEmpty Class Reference

Noop coins view. More...

#include <coins.h>

Inheritance diagram for CoinsViewEmpty:
[legend]
Collaboration diagram for CoinsViewEmpty:
[legend]

Public Member Functions

 CoinsViewEmpty (const CoinsViewEmpty &)=delete
 
CoinsViewEmptyoperator= (const CoinsViewEmpty &)=delete
 
std::optional< CoinGetCoin (const COutPoint &) const override
 Retrieve the Coin (unspent transaction output) for a given outpoint. More...
 
std::optional< CoinPeekCoin (const COutPoint &outpoint) const override
 Retrieve the Coin (unspent transaction output) for a given outpoint, without caching results. More...
 
bool HaveCoin (const COutPoint &outpoint) const override
 Just check whether a given outpoint is unspent. More...
 
uint256 GetBestBlock () const override
 Retrieve the block hash whose state this CCoinsView currently represents. More...
 
std::vector< uint256GetHeadBlocks () const override
 Retrieve the range of blocks that may have been only partially written. More...
 
void BatchWrite (CoinsViewCacheCursor &cursor, const uint256 &) override
 Do a bulk modification (multiple Coin changes + BestBlock change). More...
 
size_t EstimateSize () const override
 Estimate database size. More...
 
- Public Member Functions inherited from CCoinsView
virtual ~CCoinsView ()=default
 As we use CCoinsViews polymorphically, have a virtual destructor. More...
 
virtual std::optional< CoinGetCoin (const COutPoint &outpoint) const =0
 Retrieve the Coin (unspent transaction output) for a given outpoint. More...
 
virtual std::optional< CoinPeekCoin (const COutPoint &outpoint) const =0
 Retrieve the Coin (unspent transaction output) for a given outpoint, without caching results. More...
 
virtual bool HaveCoin (const COutPoint &outpoint) const =0
 Just check whether a given outpoint is unspent. More...
 
virtual uint256 GetBestBlock () const =0
 Retrieve the block hash whose state this CCoinsView currently represents. More...
 
virtual std::vector< uint256GetHeadBlocks () const =0
 Retrieve the range of blocks that may have been only partially written. More...
 
virtual void BatchWrite (CoinsViewCacheCursor &cursor, const uint256 &block_hash)=0
 Do a bulk modification (multiple Coin changes + BestBlock change). More...
 
virtual size_t EstimateSize () const =0
 Estimate database size. More...
 

Static Public Member Functions

static CoinsViewEmptyGet ()
 

Protected Member Functions

 CoinsViewEmpty ()=default
 

Detailed Description

Noop coins view.

Definition at line 391 of file coins.h.

Constructor & Destructor Documentation

◆ CoinsViewEmpty() [1/2]

CoinsViewEmpty::CoinsViewEmpty ( )
protecteddefault

◆ CoinsViewEmpty() [2/2]

CoinsViewEmpty::CoinsViewEmpty ( const CoinsViewEmpty )
delete

Member Function Documentation

◆ BatchWrite()

void CoinsViewEmpty::BatchWrite ( CoinsViewCacheCursor cursor,
const uint256 block_hash 
)
inlineoverridevirtual

Do a bulk modification (multiple Coin changes + BestBlock change).

The passed cursor is used to iterate through the coins.

Implements CCoinsView.

Definition at line 407 of file coins.h.

Here is the call graph for this function:

◆ EstimateSize()

size_t CoinsViewEmpty::EstimateSize ( ) const
inlineoverridevirtual

Estimate database size.

Implements CCoinsView.

Definition at line 411 of file coins.h.

◆ Get()

CoinsViewEmpty & CoinsViewEmpty::Get ( )
static

Definition at line 29 of file coins.cpp.

Here is the caller graph for this function:

◆ GetBestBlock()

uint256 CoinsViewEmpty::GetBestBlock ( ) const
inlineoverridevirtual

Retrieve the block hash whose state this CCoinsView currently represents.

Implements CCoinsView.

Definition at line 405 of file coins.h.

◆ GetCoin()

std::optional< Coin > CoinsViewEmpty::GetCoin ( const COutPoint outpoint) const
inlineoverridevirtual

Retrieve the Coin (unspent transaction output) for a given outpoint.

May populate the cache. Use PeekCoin() to perform a non-caching lookup.

Implements CCoinsView.

Definition at line 402 of file coins.h.

Here is the caller graph for this function:

◆ GetHeadBlocks()

std::vector< uint256 > CoinsViewEmpty::GetHeadBlocks ( ) const
inlineoverridevirtual

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.

Implements CCoinsView.

Definition at line 406 of file coins.h.

◆ HaveCoin()

bool CoinsViewEmpty::HaveCoin ( const COutPoint outpoint) const
inlineoverridevirtual

Just check whether a given outpoint is unspent.

May populate the cache. Use PeekCoin() to perform a non-caching lookup.

Implements CCoinsView.

Definition at line 404 of file coins.h.

Here is the call graph for this function:

◆ operator=()

CoinsViewEmpty & CoinsViewEmpty::operator= ( const CoinsViewEmpty )
delete

◆ PeekCoin()

std::optional< Coin > CoinsViewEmpty::PeekCoin ( const COutPoint outpoint) const
inlineoverridevirtual

Retrieve the Coin (unspent transaction output) for a given outpoint, without caching results.

Does not populate the cache. Use GetCoin() to cache the result.

Implements CCoinsView.

Definition at line 403 of file coins.h.

Here is the call graph for this function:

The documentation for this class was generated from the following files: