chain

package
v0.0.0-...-7bd4979 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	// contains filtered or unexported fields
}

func CreateChain

func CreateChain(s *state.State) *Chain

func (*Chain) AddBlock

func (c *Chain) AddBlock(block *block.Block) bool

func (*Chain) AddChain

func (c *Chain) AddChain(hashPath [][]byte, forkState *generated.ForkState) bool

func (*Chain) GetAddressState

func (c *Chain) GetAddressState(address []byte) (*addressstate.AddressState, error)

func (*Chain) GetBlock

func (c *Chain) GetBlock(headerhash []byte) (*block.Block, error)

func (*Chain) GetBlockByNumber

func (c *Chain) GetBlockByNumber(blockNumber uint64) (*block.Block, error)

func (*Chain) GetBlockMetaData

func (c *Chain) GetBlockMetaData(headerhash []byte) (*metadata.BlockMetaData, error)

func (*Chain) GetBlockSizeLimit

func (c *Chain) GetBlockSizeLimit(b *block.Block) (int, error)

func (*Chain) GetForkPoint

func (c *Chain) GetForkPoint(block *block.Block) ([]byte, [][]byte, error)

func (*Chain) GetHeaderHashes

func (c *Chain) GetHeaderHashes(blockNumber uint64, count uint64) (*generated.NodeHeaderHash, error)

func (*Chain) GetLastBlock

func (c *Chain) GetLastBlock() *block.Block

func (*Chain) GetMeasurement

func (c *Chain) GetMeasurement(blockTimestamp uint32, parentHeaderHash []byte, parentMetaData *metadata.BlockMetaData) (uint64, error)

func (*Chain) GetTransactionByHash

func (c *Chain) GetTransactionByHash(txHash []byte) (*generated.Transaction, error)

func (*Chain) GetTransactionMetaDataByHash

func (c *Chain) GetTransactionMetaDataByHash(txHash []byte) (*generated.TransactionMetadata, error)

func (*Chain) GetTransactionPool

func (c *Chain) GetTransactionPool() *pool.TransactionPool

func (*Chain) GetTxPool

func (c *Chain) GetTxPool() *pool.TransactionPool

func (*Chain) Height

func (c *Chain) Height() uint64

func (*Chain) Load

func (c *Chain) Load(genesisBlock *block.Block) error

func (*Chain) RemoveBlockFromMainchain

func (c *Chain) RemoveBlockFromMainchain(block *block.Block, blockNumber uint64, batch *leveldb.Batch)

func (*Chain) Rollback

func (c *Chain) Rollback(forkedHeaderHash []byte, forkState *generated.ForkState) [][]byte

func (*Chain) SetDifficultyTracker

func (c *Chain) SetDifficultyTracker(dt pow.DifficultyTrackerInterface)

func (*Chain) SetNewBlockNotificationChannel

func (c *Chain) SetNewBlockNotificationChannel(newBlockNotificationChannel chan []byte)

Jump to

Keyboard shortcuts

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