legacy

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCorruptedFwdPkg = errors.New("fwding package db has been corrupted")

ErrCorruptedFwdPkg signals that the on-disk structure of the forwarding package has potentially been mangled.

Functions

func DeserializeCloseChannelSummary

func DeserializeCloseChannelSummary(r io.Reader) (*common.ChannelCloseSummary, error)

func DeserializeCommitDiff

func DeserializeCommitDiff(r io.Reader) (*common.CommitDiff, error)

func DeserializeLogUpdates

func DeserializeLogUpdates(r io.Reader) ([]common.LogUpdate, error)

func DeserializeNetworkResult

func DeserializeNetworkResult(r io.Reader) (*common.NetworkResult, error)

func ReadElement

func ReadElement(r io.Reader, element interface{}) error

ReadElement is a one-stop utility function to deserialize any datastructure encoded using the serialization format of the database.

func ReadElements

func ReadElements(r io.Reader, elements ...interface{}) error

ReadElements deserializes a variable number of elements into the passed io.Reader, with each element being deserialized according to the ReadElement function.

func SerializeChannelCloseSummary

func SerializeChannelCloseSummary(w io.Writer, cs *common.ChannelCloseSummary) error

func SerializeCommitDiff

func SerializeCommitDiff(w io.Writer, diff *common.CommitDiff) error

func SerializeLogUpdates

func SerializeLogUpdates(w io.Writer, logUpdates []common.LogUpdate) error

func SerializeNetworkResult

func SerializeNetworkResult(w io.Writer, n *common.NetworkResult) error

func WriteElement

func WriteElement(w io.Writer, element interface{}) error

WriteElement is a one-stop shop to write the big endian representation of any element which is to be serialized for storage on disk. The passed io.Writer should be backed by an appropriately sized byte slice, or be able to dynamically expand to accommodate additional data.

func WriteElements

func WriteElements(w io.Writer, elements ...interface{}) error

WriteElements is writes each element in the elements slice to the passed io.Writer using WriteElement.

Types

type ChannelPackager

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

ChannelPackager is used by a channel to manage the lifecycle of its forwarding packages. The packager is tied to a particular source channel ID, allowing it to create and edit its own packages. Each packager also has the ability to remove fail/settle htlcs that correspond to an add contained in one of source's packages.

func NewChannelPackager

func NewChannelPackager(source lnwire.ShortChannelID) *ChannelPackager

NewChannelPackager creates a new packager for a single channel.

func (*ChannelPackager) AddFwdPkg

func (*ChannelPackager) AddFwdPkg(tx kvdb.RwTx, fwdPkg *common.FwdPkg) error

AddFwdPkg writes a newly locked in forwarding package to disk.

func (*ChannelPackager) LoadFwdPkgs

func (p *ChannelPackager) LoadFwdPkgs(tx kvdb.RTx) ([]*common.FwdPkg, error)

LoadFwdPkgs scans the forwarding log for any packages that haven't been processed, and returns their deserialized log updates in a map indexed by the remote commitment height at which the updates were locked in.

type UnknownElementType

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

UnknownElementType is an error returned when the codec is unable to encode or decode a particular type.

func NewUnknownElementType

func NewUnknownElementType(method string, el interface{}) UnknownElementType

NewUnknownElementType creates a new UnknownElementType error from the passed method name and element.

func (UnknownElementType) Error

func (e UnknownElementType) Error() string

Error returns the name of the method that encountered the error, as well as the type that was unsupported.

Jump to

Keyboard shortcuts

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