Bitcoin
|
#include <chain.h>
Public Member Functions | |
virtual | ~Lock () |
virtual Optional< int > | getHeight ()=0 |
virtual Optional< int > | getBlockHeight (const uint256 &hash)=0 |
virtual int | getBlockDepth (const uint256 &hash)=0 |
virtual uint256 | getBlockHash (int height)=0 |
Get block hash. Height must be valid or this function will abort. More... | |
virtual int64_t | getBlockTime (int height)=0 |
Get block time. Height must be valid or this function will abort. More... | |
virtual int64_t | getBlockMedianTimePast (int height)=0 |
virtual bool | haveBlockOnDisk (int height)=0 |
virtual Optional< int > | findFirstBlockWithTimeAndHeight (int64_t time, int height, uint256 *hash)=0 |
virtual Optional< int > | findPruned (int start_height=0, Optional< int > stop_height=nullopt)=0 |
virtual Optional< int > | findFork (const uint256 &hash, Optional< int > *height)=0 |
virtual CBlockLocator | getTipLocator ()=0 |
Get locator for the current chain tip. More... | |
virtual Optional< int > | findLocatorFork (const CBlockLocator &locator)=0 |
virtual bool | checkFinalTx (const CTransaction &tx)=0 |
Check if transaction will be final given chain height current time. More... | |
virtual bool | submitToMemoryPool (const CTransactionRef &tx, CAmount absurd_fee, CValidationState &state)=0 |
Interface for querying locked chain state, used by legacy code that assumes state won't change between calls. New code should avoid using the Lock interface and instead call higher-level Chain methods that return more information so the chain doesn't need to stay locked between calls.
|
inlinevirtual |
|
pure virtual |
Check if transaction will be final given chain height current time.
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
|
pure virtual |
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.)
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
|
pure virtual |
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).
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
|
pure virtual |
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.
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
|
pure virtual |
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.
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
|
pure virtual |
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.
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
|
pure virtual |
Get block hash. Height must be valid or this function will abort.
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
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.
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
|
pure virtual |
Get block median time past. Height must be valid or this function will abort.
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
|
pure virtual |
Get block time. Height must be valid or this function will abort.
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
|
pure virtual |
Get current chain height, not including genesis block (returns 0 if chain only contains genesis block, nullopt if chain does not contain any blocks).
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
|
pure virtual |
Get locator for the current chain tip.
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
|
pure virtual |
Check that the block is available on disk (i.e. has not been pruned), and contains transactions.
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.
|
pure virtual |
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.
Implemented in interfaces::anonymous_namespace{chain.cpp}::LockImpl.