Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 (*Store) ValidateNetwork ¶
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.