Bitcoin
Private Member Functions | List of all members
interfaces::anonymous_namespace{chain.cpp}::LockImpl Class Reference
Inheritance diagram for interfaces::anonymous_namespace{chain.cpp}::LockImpl:
interfaces::Chain::Lock UniqueLock< CCriticalSection >

Private Member Functions

Optional< int > getHeight () override
 
Optional< int > getBlockHeight (const uint256 &hash) override
 
int getBlockDepth (const uint256 &hash) override
 
uint256 getBlockHash (int height) override
 Get block hash. Height must be valid or this function will abort. More...
 
int64_t getBlockTime (int height) override
 Get block time. Height must be valid or this function will abort. More...
 
int64_t getBlockMedianTimePast (int height) override
 
bool haveBlockOnDisk (int height) override
 
Optional< int > findFirstBlockWithTimeAndHeight (int64_t time, int height, uint256 *hash) override
 
Optional< int > findPruned (int start_height, Optional< int > stop_height) override
 
Optional< int > findFork (const uint256 &hash, Optional< int > *height) override
 
CBlockLocator getTipLocator () override
 Get locator for the current chain tip. More...
 
Optional< int > findLocatorFork (const CBlockLocator &locator) override
 
bool checkFinalTx (const CTransaction &tx) override
 Check if transaction will be final given chain height current time. More...
 
bool submitToMemoryPool (const CTransactionRef &tx, CAmount absurd_fee, CValidationState &state) override
 
 UniqueLock (Mutex &mutexIn, const char *pszName, const char *pszFile, int nLine, bool fTry=false) EXCLUSIVE_LOCK_FUNCTION(mutexIn)
 
 UniqueLock (Mutex *pmutexIn, const char *pszName, const char *pszFile, int nLine, bool fTry=false) EXCLUSIVE_LOCK_FUNCTION(pmutexIn)
 

Additional Inherited Members

- Public Member Functions inherited from interfaces::Chain::Lock
virtual ~Lock ()
 
- Public Member Functions inherited from UniqueLock< CCriticalSection >
 UniqueLock (CCriticalSection &mutexIn, const char *pszName, const char *pszFile, int nLine, bool fTry=false) EXCLUSIVE_LOCK_FUNCTION(mutexIn)
 
 UniqueLock (CCriticalSection *pmutexIn, const char *pszName, const char *pszFile, int nLine, bool fTry=false) EXCLUSIVE_LOCK_FUNCTION(pmutexIn)
 
 ~UniqueLock () UNLOCK_FUNCTION()
 
 operator bool ()
 

Member Function Documentation

◆ checkFinalTx()

bool interfaces::anonymous_namespace{chain.cpp}::LockImpl::checkFinalTx ( const CTransaction tx)
inlineoverrideprivatevirtual

Check if transaction will be final given chain height current time.

Implements interfaces::Chain::Lock.

◆ findFirstBlockWithTimeAndHeight()

Optional<int> interfaces::anonymous_namespace{chain.cpp}::LockImpl::findFirstBlockWithTimeAndHeight ( int64_t  time,
int  height,
uint256 hash 
)
inlineoverrideprivatevirtual

Return height of the first block in the chain with timestamp equal or greater than the given time and height equal or greater than the given height, or nullopt if there is no block with a high enough timestamp and height. Also return the block hash as an optional output parameter (to avoid the cost of a second lookup in case this information is needed.)

Implements interfaces::Chain::Lock.

◆ findFork()

Optional<int> interfaces::anonymous_namespace{chain.cpp}::LockImpl::findFork ( const uint256 hash,
Optional< int > *  height 
)
inlineoverrideprivatevirtual

Return height of the specified block if it is on the chain, otherwise return the height of the highest block on chain that's an ancestor of the specified block, or nullopt if there is no common ancestor. Also return the height of the specified block as an optional output parameter (to avoid the cost of a second hash lookup in case this information is desired).

Implements interfaces::Chain::Lock.

◆ findLocatorFork()

Optional<int> interfaces::anonymous_namespace{chain.cpp}::LockImpl::findLocatorFork ( const CBlockLocator locator)
inlineoverrideprivatevirtual

Return height of the highest block on chain in common with the locator, which will either be the original block used to create the locator, or one of its ancestors.

Implements interfaces::Chain::Lock.

◆ findPruned()

Optional<int> interfaces::anonymous_namespace{chain.cpp}::LockImpl::findPruned ( int  start_height,
Optional< int >  stop_height 
)
inlineoverrideprivatevirtual

Return height of last block in the specified range which is pruned, or nullopt if no block in the range is pruned. Range is inclusive.

Implements interfaces::Chain::Lock.

◆ getBlockDepth()

int interfaces::anonymous_namespace{chain.cpp}::LockImpl::getBlockDepth ( const uint256 hash)
inlineoverrideprivatevirtual

Get block depth. Returns 1 for chain tip, 2 for preceding block, and so on. Returns 0 for a block not included in the current chain.

Implements interfaces::Chain::Lock.

◆ getBlockHash()

uint256 interfaces::anonymous_namespace{chain.cpp}::LockImpl::getBlockHash ( int  height)
inlineoverrideprivatevirtual

Get block hash. Height must be valid or this function will abort.

Implements interfaces::Chain::Lock.

◆ getBlockHeight()

Optional<int> interfaces::anonymous_namespace{chain.cpp}::LockImpl::getBlockHeight ( const uint256 hash)
inlineoverrideprivatevirtual

Get block height above genesis block. Returns 0 for genesis block, 1 for following block, and so on. Returns nullopt for a block not included in the current chain.

Implements interfaces::Chain::Lock.

◆ getBlockMedianTimePast()

int64_t interfaces::anonymous_namespace{chain.cpp}::LockImpl::getBlockMedianTimePast ( int  height)
inlineoverrideprivatevirtual

Get block median time past. Height must be valid or this function will abort.

Implements interfaces::Chain::Lock.

◆ getBlockTime()

int64_t interfaces::anonymous_namespace{chain.cpp}::LockImpl::getBlockTime ( int  height)
inlineoverrideprivatevirtual

Get block time. Height must be valid or this function will abort.

Implements interfaces::Chain::Lock.

◆ getHeight()

Optional<int> interfaces::anonymous_namespace{chain.cpp}::LockImpl::getHeight ( )
inlineoverrideprivatevirtual

Get current chain height, not including genesis block (returns 0 if chain only contains genesis block, nullopt if chain does not contain any blocks).

Implements interfaces::Chain::Lock.

◆ getTipLocator()

CBlockLocator interfaces::anonymous_namespace{chain.cpp}::LockImpl::getTipLocator ( )
inlineoverrideprivatevirtual

Get locator for the current chain tip.

Implements interfaces::Chain::Lock.

◆ haveBlockOnDisk()

bool interfaces::anonymous_namespace{chain.cpp}::LockImpl::haveBlockOnDisk ( int  height)
inlineoverrideprivatevirtual

Check that the block is available on disk (i.e. has not been pruned), and contains transactions.

Implements interfaces::Chain::Lock.

◆ submitToMemoryPool()

bool interfaces::anonymous_namespace{chain.cpp}::LockImpl::submitToMemoryPool ( const CTransactionRef tx,
CAmount  absurd_fee,
CValidationState state 
)
inlineoverrideprivatevirtual

Add transaction to memory pool if the transaction fee is below the amount specified by absurd_fee. Returns false if the transaction could not be added due to the fee or for another reason.

Implements interfaces::Chain::Lock.

◆ UniqueLock() [1/2]

UniqueLock< Mutex, Base >::UniqueLock
inlineprivate

◆ UniqueLock() [2/2]

UniqueLock< Mutex, Base >::UniqueLock
inlineprivate

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