migration29

package
v0.15.5-beta Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateChanID

func MigrateChanID(tx kvdb.RwTx) error

MigrateChanID populates the ChannelID index by using the set of outpoints retrieved from the outpoint bucket.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specific Logger to output package logging info.

Types

type ChannelID

type ChannelID [32]byte

ChannelID is a series of 32-bytes that uniquely identifies all channels within the network. The ChannelID is computed using the outpoint of the funding transaction (the txid, and output index). Given a funding output the ChannelID can be calculated by XOR'ing the big-endian serialization of the txid and the big-endian serialization of the output index, truncated to 2 bytes.

func NewChanIDFromOutPoint

func NewChanIDFromOutPoint(op *wire.OutPoint) ChannelID

NewChanIDFromOutPoint converts a target OutPoint into a ChannelID that is usable within the network. In order to convert the OutPoint into a ChannelID, we XOR the lower 2-bytes of the txid within the OutPoint with the big-endian serialization of the Index of the OutPoint, truncated to 2-bytes.

func (ChannelID) String

func (c ChannelID) String() string

String returns the string representation of the ChannelID. This is just the hex string encoding of the ChannelID itself.

Jump to

Keyboard shortcuts

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