Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBlockTooLow = errors.New("new block number is lower than the latest block")
ErrBlockTooLow when the block number is lower than the latest block.
Functions ¶
This section is empty.
Types ¶
type BlockManager ¶
type BlockManager struct {
// contains filtered or unexported fields
}
BlockManager is a singleton structure to hold the latest block application-wide.
func GetInstance ¶
func GetInstance() *BlockManager
GetInstance ensures a single instance of BlockManager.
func (*BlockManager) GetLatestBlock ¶
func (b *BlockManager) GetLatestBlock() int64
GetLatestBlock returns the current latest block number.
func (*BlockManager) SetLatestBlock ¶
func (b *BlockManager) SetLatestBlock(newBlock int64) error
SetLatestBlock updates the latest block if it's greater than the current one.
Click to show internal directories.
Click to hide internal directories.