veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altintegration::BtcChainParams Struct Referenceabstract

base class for BTC params More...

Detailed Description

Definition at line 18 of file btc_chain_params.hpp.

#include <btc_chain_params.hpp>

+ Inheritance diagram for altintegration::BtcChainParams:
+ Collaboration diagram for altintegration::BtcChainParams:

Public Member Functions

virtual uint256 getPowLimit () const =0
 
virtual uint32_t getPowTargetTimespan () const noexcept=0
 
virtual uint32_t getPowTargetSpacing () const noexcept=0
 
virtual bool getAllowMinDifficultyBlocks () const noexcept=0
 
virtual bool getPowNoRetargeting () const noexcept=0
 
virtual bool EnableTimeAdjustment () const noexcept=0
 
uint32_t getDifficultyAdjustmentInterval () const noexcept
 
virtual uint32_t numBlocksForBootstrap () const noexcept=0
 minimum number of BTC blocks needed to bootstrap chain More...
 
virtual const char * networkName () const noexcept=0
 
virtual uint32_t maxFutureBlockTime () const noexcept
 
int32_t getMaxReorgBlocks () const noexcept
 by default we store this many last BTC blocks in RAM More...
 
uint32_t preserveBlocksBehindFinal () const noexcept
 when finalizeBlockImpl is called, this many blocks behind final block will be preserved in RAM. More...
 
int32_t getOldBlocksWindow () const noexcept
 all blocks further than this number of blocks are considered "old" More...
 

Public Attributes

uint32_t mOldBlocksWindow = 1000
 
int32_t mMaxReorgBlocks = BTC_MAX_REORG_BLOCKS_MIN_VALUE
 

Protected Attributes

uint32_t mMaxFutureBlockTime = 2 * 60 * 60
 

Member Function Documentation

◆ EnableTimeAdjustment()

virtual bool altintegration::BtcChainParams::EnableTimeAdjustment ( ) const
pure virtualnoexcept

◆ getDifficultyAdjustmentInterval()

uint32_t altintegration::BtcChainParams::getDifficultyAdjustmentInterval ( ) const
inlinenoexcept

Definition at line 27 of file btc_chain_params.hpp.

27 {
28 return getPowTargetTimespan() / getPowTargetSpacing();
29 }

◆ getMaxReorgBlocks()

int32_t altintegration::BtcChainParams::getMaxReorgBlocks ( ) const
inlinenoexcept

Definition at line 38 of file btc_chain_params.hpp.

38 {
39 VBK_ASSERT(static_cast<uint32_t>(mMaxReorgBlocks) >=
40 getDifficultyAdjustmentInterval());
41 return mMaxReorgBlocks;
42 }

◆ getOldBlocksWindow()

int32_t altintegration::BtcChainParams::getOldBlocksWindow ( ) const
inlinenoexcept

Definition at line 49 of file btc_chain_params.hpp.

49{ return mOldBlocksWindow; }

◆ maxFutureBlockTime()

virtual uint32_t altintegration::BtcChainParams::maxFutureBlockTime ( ) const
inlinevirtualnoexcept

Definition at line 33 of file btc_chain_params.hpp.

33 {
34 return mMaxFutureBlockTime;
35 }

◆ numBlocksForBootstrap()

virtual uint32_t altintegration::BtcChainParams::numBlocksForBootstrap ( ) const
pure virtualnoexcept

◆ preserveBlocksBehindFinal()

uint32_t altintegration::BtcChainParams::preserveBlocksBehindFinal ( ) const
inlinenoexcept

In BTC we can deallocate all blocks past final block.

Definition at line 46 of file btc_chain_params.hpp.

46{ return 0; }

Member Data Documentation

◆ mMaxFutureBlockTime

uint32_t altintegration::BtcChainParams::mMaxFutureBlockTime = 2 * 60 * 60
protected

Definition at line 55 of file btc_chain_params.hpp.

◆ mMaxReorgBlocks

int32_t altintegration::BtcChainParams::mMaxReorgBlocks = BTC_MAX_REORG_BLOCKS_MIN_VALUE

Definition at line 52 of file btc_chain_params.hpp.

◆ mOldBlocksWindow

uint32_t altintegration::BtcChainParams::mOldBlocksWindow = 1000

Definition at line 51 of file btc_chain_params.hpp.


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