migration5

package
v0.18.0-beta Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const SessionIDSize = 33

SessionIDSize is 33-bytes; it is a serialized, compressed public key.

Variables

View Source
var (

	// ErrUninitializedDB signals that top-level buckets for the database
	// have not been initialized.
	ErrUninitializedDB = errors.New("db not initialized")
)

Functions

func MigrateCompleteTowerToSessionIndex

func MigrateCompleteTowerToSessionIndex(tx kvdb.RwTx) error

MigrateCompleteTowerToSessionIndex ensures that the tower-to-session index contains entries for all towers in the db. This is necessary because migration1 only created entries in the index for towers that the client had at least one session with. This migration thus makes sure that there is always a tower-to-sessions index entry for a tower even if there are no sessions with that tower.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type SessionID

type SessionID [SessionIDSize]byte

SessionID is created from the remote public key of a client, and serves as a unique identifier and authentication for sending state updates.

type TowerID

type TowerID uint64

TowerID is a unique 64-bit identifier allocated to each unique watchtower. This allows the client to conserve on-disk space by not needing to always reference towers by their pubkey.

func TowerIDFromBytes

func TowerIDFromBytes(towerIDBytes []byte) (TowerID, error)

TowerIDFromBytes constructs a TowerID from the provided byte slice. The argument must have at least 8 bytes, and should contain the TowerID in big-endian byte order.

func (TowerID) Bytes

func (id TowerID) Bytes() []byte

Bytes encodes a TowerID into an 8-byte slice in big-endian byte order.

Jump to

Keyboard shortcuts

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