Documentation ¶
Index ¶
- Variables
- func DeserializeCloseChannelSummary(r io.Reader) (*common.ChannelCloseSummary, error)
- func DeserializeCommitDiff(r io.Reader) (*common.CommitDiff, error)
- func DeserializeLogUpdates(r io.Reader) ([]common.LogUpdate, error)
- func DeserializeNetworkResult(r io.Reader) (*common.NetworkResult, error)
- func ReadElement(r io.Reader, element interface{}) error
- func ReadElements(r io.Reader, elements ...interface{}) error
- func SerializeChannelCloseSummary(w io.Writer, cs *common.ChannelCloseSummary) error
- func SerializeCommitDiff(w io.Writer, diff *common.CommitDiff) error
- func SerializeLogUpdates(w io.Writer, logUpdates []common.LogUpdate) error
- func SerializeNetworkResult(w io.Writer, n *common.NetworkResult) error
- func WriteElement(w io.Writer, element interface{}) error
- func WriteElements(w io.Writer, elements ...interface{}) error
- type ChannelPackager
- type UnknownElementType
Constants ¶
This section is empty.
Variables ¶
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 DeserializeNetworkResult ¶
func DeserializeNetworkResult(r io.Reader) (*common.NetworkResult, error)
func ReadElement ¶
ReadElement is a one-stop utility function to deserialize any datastructure encoded using the serialization format of the database.
func ReadElements ¶
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 SerializeNetworkResult ¶
func SerializeNetworkResult(w io.Writer, n *common.NetworkResult) error
func WriteElement ¶
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 ¶
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) LoadFwdPkgs ¶
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.