chainparams

package
v0.21.0-beta.rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNetworkMismatch = errors.New("database network mismatch")

ErrNetworkMismatch is returned by ValidateNetwork when the network stored in the database does not match the network lnd is configured to use.

Functions

This section is empty.

Types

type BatchedChainParamQueries

type BatchedChainParamQueries interface {
	SQLChainParamQueries

	sqldb.BatchedTx[SQLChainParamQueries]
}

BatchedChainParamQueries is a version of SQLChainParamQueries that is capable of batched database operations.

type SQLChainParamQueries

type SQLChainParamQueries interface {
	InsertChainNetwork(ctx context.Context, network string) error
	GetChainNetwork(ctx context.Context) (string, error)
}

SQLChainParamQueries defines the SQL queries required by Store.

type Store

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

Store is a database-backed store that persists and retrieves chain-level parameters such as the network the database was initialised for.

func NewStore

func NewStore(db *sqldb.BaseDB) *Store

NewStore creates a new chain params Store backed by the given BaseDB.

func (*Store) ValidateNetwork

func (s *Store) ValidateNetwork(ctx context.Context,
	net *chaincfg.Params) error

ValidateNetwork checks that the network stored in the chain_params table matches the provided network. On the first call the network is persisted so that subsequent restarts can detect an accidental network switch.

Jump to

Keyboard shortcuts

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