Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.h
Show All 11 Lines | |||||
#include <string> | #include <string> | ||||
#include <vector> | #include <vector> | ||||
struct BlockHash; | struct BlockHash; | ||||
class CBlock; | class CBlock; | ||||
struct CBlockLocator; | struct CBlockLocator; | ||||
class CChainParams; | class CChainParams; | ||||
class CScheduler; | class CScheduler; | ||||
class CTransaction; | |||||
class CValidationState; | |||||
namespace Consensus { | |||||
struct Params; | |||||
} | |||||
namespace interfaces { | namespace interfaces { | ||||
//! Interface for giving wallet processes access to blockchain state. | //! Interface for giving wallet processes access to blockchain state. | ||||
class Chain { | class Chain { | ||||
public: | public: | ||||
virtual ~Chain() {} | virtual ~Chain() {} | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | public: | ||||
//! Get locator for the current chain tip. | //! Get locator for the current chain tip. | ||||
virtual CBlockLocator getLocator() = 0; | virtual CBlockLocator getLocator() = 0; | ||||
//! Return height of the latest block common to locator and chain, which | //! Return height of the latest block common to locator and chain, which | ||||
//! is guaranteed to be an ancestor of the block used to create the | //! is guaranteed to be an ancestor of the block used to create the | ||||
//! locator. | //! locator. | ||||
virtual Optional<int> findLocatorFork(const CBlockLocator &locator) = 0; | virtual Optional<int> findLocatorFork(const CBlockLocator &locator) = 0; | ||||
//! Check if transaction will be final given chain height current time. | |||||
virtual bool contextualCheckTransactionForCurrentBlock( | |||||
const Consensus::Params ¶ms, const CTransaction &tx, | |||||
CValidationState &state) = 0; | |||||
}; | }; | ||||
//! Return Lock interface. Chain is locked when this is called, and | //! Return Lock interface. Chain is locked when this is called, and | ||||
//! unlocked when the returned interface is freed. | //! unlocked when the returned interface is freed. | ||||
virtual std::unique_ptr<Lock> lock(bool try_lock = false) = 0; | virtual std::unique_ptr<Lock> lock(bool try_lock = false) = 0; | ||||
//! Return Lock interface assuming chain is already locked. This | //! Return Lock interface assuming chain is already locked. This | ||||
//! method is temporary and is only used in a few places to avoid changing | //! method is temporary and is only used in a few places to avoid changing | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |