Documentation ¶
Index ¶
- Constants
- func ActivateBestChain(pblock *block.Block) error
- func ActivateBestChainStep(pindexMostWork *blockindex.BlockIndex, pblock *block.Block, ...) error
- func CheckBlockIndex() error
- func ConnectBlock(pblock *block.Block, pindex *blockindex.BlockIndex, view *utxo.CoinsMap, ...) error
- func ConnectTip(pIndexNew *blockindex.BlockIndex, block *block.Block, connTrace connectTrace) error
- func DisconnectBlock(pblock *block.Block, pindex *blockindex.BlockIndex, view *utxo.CoinsMap) undo.DisconnectResult
- func DisconnectTip(fBare bool) error
- func FindForkInGlobalIndex(chains *chain.Chain, locator *chain.BlockLocator) *blockindex.BlockIndex
- func GuessVerificationProgress(data *model.ChainTxData, index *blockindex.BlockIndex) float64
- func InitGenesisChain() error
- func InvalidBlockFound(pindex *blockindex.BlockIndex)
- func InvalidBlockParentFound(pindex *blockindex.BlockIndex)
- func IsInitialBlockDownload() bool
- func LocateBlocks(locator *chain.BlockLocator, endHash *util.Hash) []util.Hash
- func LocateHeaders(locator *chain.BlockLocator, endHash *util.Hash) []block.BlockHeader
- func UpdateTip(pindexNew *blockindex.BlockIndex)
- type UTXOStat
Constants ¶
const ( MaxHeadersResults = 2000 MaxBlocksResults = 500 )
Variables ¶
This section is empty.
Functions ¶
func ActivateBestChain ¶
ActivateBestChain Make the best chain active, in multiple steps. The result is either failure or an activated best chain. pblock is either nullptr or a pointer to a block that is already loaded (to avoid loading it again from disk). Find the best known block, and make it the tip of the block chain
func ActivateBestChainStep ¶
func ActivateBestChainStep(pindexMostWork *blockindex.BlockIndex, pblock *block.Block, fInvalidFound *bool, connTrace connectTrace) error
ActivateBestChainStep Try to make some progress towards making pindexMostWork the active block. pblock is either nullptr or a pointer to a CBlock corresponding to pindexMostWork.
func CheckBlockIndex ¶
func CheckBlockIndex() error
func ConnectBlock ¶
func ConnectBlock(pblock *block.Block, pindex *blockindex.BlockIndex, view *utxo.CoinsMap, fJustCheck bool) error
func ConnectTip ¶
func ConnectTip(pIndexNew *blockindex.BlockIndex, block *block.Block, connTrace connectTrace) error
ConnectTip Connect a new block to chainActive. block is either nullptr or a pointer to a CBlock corresponding to indexNew, to bypass loading it again from disk. The block is always added to connectTrace (either after loading from disk or by copying block) - if that is not intended, care must be taken to remove the last entry in blocksConnected in case of failure.
func DisconnectBlock ¶
func DisconnectBlock(pblock *block.Block, pindex *blockindex.BlockIndex, view *utxo.CoinsMap) undo.DisconnectResult
func DisconnectTip ¶
DisconnectTip Disconnect chainActive's tip. You probably want to call mempool.removeForReorg and manually re-limit mempool size after this, with cs_main held.
func FindForkInGlobalIndex ¶
func FindForkInGlobalIndex(chains *chain.Chain, locator *chain.BlockLocator) *blockindex.BlockIndex
func GuessVerificationProgress ¶
func GuessVerificationProgress(data *model.ChainTxData, index *blockindex.BlockIndex) float64
GuessVerificationProgress Guess how far we are in the verification process at the given block index
func InitGenesisChain ¶
func InitGenesisChain() error
func InvalidBlockFound ¶
func InvalidBlockFound(pindex *blockindex.BlockIndex)
InvalidBlockFound the found block is invalid
func InvalidBlockParentFound ¶ added in v0.0.3
func InvalidBlockParentFound(pindex *blockindex.BlockIndex)
func IsInitialBlockDownload ¶
func IsInitialBlockDownload() bool
IsInitialBlockDownload Check whether we are doing an initial block download (synchronizing from disk or network)
func LocateBlocks ¶
func LocateHeaders ¶
func LocateHeaders(locator *chain.BlockLocator, endHash *util.Hash) []block.BlockHeader
func UpdateTip ¶
func UpdateTip(pindexNew *blockindex.BlockIndex)
UpdateTip Update chainActive and related internal data structures.