Documentation ¶
Index ¶
- type Block
- type ChainBase
- func (c *ChainBase) Add(blk *block.Block, replay bool, gen bool) error
- func (c *ChainBase) BlockCache() blockcache.BlockCache
- func (c *ChainBase) BlockChain() block.Chain
- func (c *ChainBase) Close()
- func (c *ChainBase) GetBlockByHash(hash []byte) (*Block, bool)
- func (c *ChainBase) GetBlockHashByNum(num int64) ([]byte, bool)
- func (c *ChainBase) HeadBlock() *Block
- func (c *ChainBase) LIBlock() *Block
- func (c *ChainBase) StateDB() db.MVCCDB
- func (c *ChainBase) TxPool() txpool.TxPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { *block.Block *blockcache.WitnessList Irreversible bool }
Block will describe the block of chainbase.
type ChainBase ¶
type ChainBase struct {
// contains filtered or unexported fields
}
ChainBase will maintain blockchain data for memory and hard disk.
func NewMock ¶
func NewMock(bChain block.Chain, bCache blockcache.BlockCache) *ChainBase
NewMock will return the chainbase composed of blockchain and blockcache.
func (*ChainBase) BlockCache ¶
func (c *ChainBase) BlockCache() blockcache.BlockCache
BlockCache return the block cache.
func (*ChainBase) BlockChain ¶
BlockChain return the block chain database.
func (*ChainBase) GetBlockByHash ¶
GetBlockByHash will return the block by hash. If block is not exist, it will return nil and false.
func (*ChainBase) GetBlockHashByNum ¶
GetBlockHashByNum will return the block hash by number. If block hash is not exist, it will return nil and false.
Click to show internal directories.
Click to hide internal directories.