block

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

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