lchain

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2018 License: BSD-2-Clause Imports: 34 Imported by: 13

Documentation

Index

Constants

View Source
const (
	MaxHeadersResults = 2000
	MaxBlocksResults  = 500
)

Variables

This section is empty.

Functions

func ActivateBestChain

func ActivateBestChain(pblock *block.Block) error

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

func DisconnectTip(fBare bool) error

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 LocateBlocks

func LocateBlocks(locator *chain.BlockLocator, endHash *util.Hash) []util.Hash

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.

Types

type UTXOStat added in v0.0.2

type UTXOStat struct {
	Height         int
	BestBlock      util.Hash
	TxCount        uint64
	TxOutsCount    uint64
	HashSerialized util.Hash
	Amount         int64
	BogoSize       uint64
	DiskSize       uint64
}

func GetUTXOStats

func GetUTXOStats(cdb utxo.CoinsDB) (*UTXOStat, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL