package
0.4.2-beta
Repository: https://github.com/philangist/lnd.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

DisableLog disables all library log output.
ExpectedFee computes the expected fee for a given htlc amount.
New creates the new instance of htlc switch.
NewBatchTicker returns a new BatchTicker that wraps the passed time.Ticker.
NewChannelLink creates a new instance of a ChannelLink given a configuration and active channel that will be used to verify/apply updates to.
NewCircuitMap creates a new instance of the circuitMap.
NewDecayedLog creates a new DecayedLog, which caches recently seen hash shared secrets.
NewMockObfuscator initializes a dummy mockObfuscator used for testing.
NewOnionProcessor creates new instance of decoder.
NewPersistentSequencer initializes a new sequencer using a channeldb backend.
NewSphinxErrorEncrypter initializes a blank sphinx error encrypter, that should be used to deserialize an encoded SphinxErrorEncrypter.
UseLogger uses a specified Logger to output package logging info.

# Constants

BitcoinHop denotes that an HTLC is to be forwarded along the Bitcoin link with the specified short channel ID.
CloseBreach indicates that a channel breach has been detected, and the link should immediately be marked as unavailable.
CloseRegular indicates a regular cooperative channel closure should be attempted.
EncrypterTypeMock is used to identify a mock obfuscator instance.
EncrypterTypeNone signals that no error encyrpter is present, this can happen if the htlc is originates in the switch.
EncrypterTypeSphinx is used to identify a sphinx onion error encrypter instance.
ErrInternalError indicates that something internal in the link failed.
ErrInvalidCommitment indicates that the remote peer sent us an invalid commitment signature.
ErrInvalidRevocation indicates that the remote peer send us an invalid revocation message.
ErrInvalidUpdate indicates that the peer send us an invalid update.
ErrRemoteError indicates that our peer sent an error, prompting up to fail the link.
ErrSyncError indicates that we failed synchronizing the state of the channel with our peer.
LitecoinHop denotes that an HTLC is to be forwarded along the Litecoin link with the specified short channel ID.

# Variables

EmptyCircuitKey is a default value for an outgoing circuit key returned when a circuit's keystone has not been set.
ErrChannelLinkNotFound is used when channel link hasn't been found.
ErrCircuitClosing signals that an htlc has already closed this circuit in-memory.
ErrCircuitNotInHashIndex indicates that a particular circuit did not appear in the in-memory hash index.
ErrCorruptedCircuitMap indicates that the on-disk bucketing structure has altered since the circuit map instance was initialized.
ErrDecayedLogCorrupted signals that the anticipated bucketing structure has diverged since initialization.
ErrDecayedLogInit is used to indicate a decayed log failed to create the proper bucketing structure on startup.
ErrDuplicateAdd signals that the ADD htlc was already forwarded through the switch and is locked into another commitment txn.
ErrDuplicateCircuit signals that this circuit was previously added.
ErrDuplicateKeystone signals that this circuit was previously assigned a keystone.
ErrIncompleteForward is used when an htlc was already forwarded through the switch, but did not get locked into another commitment txn.
ErrLinkShuttingDown signals that the link is shutting down.
ErrMailBoxShuttingDown is returned when the mailbox is interrupted by a shutdown request.
ErrSequencerCorrupted signals that the persistence engine was not initialized, or has been corrupted since startup.
ErrUnknownCircuit signals that circuit could not be removed from the map because it was not found.
ErrUnknownKeystone signals that no circuit was found using the outgoing circuit key.

# Structs

BatchTicker implements the Ticker interface, and wraps a time.Ticker.
ChanClose represents a request which close a particular channel specified by its id.
ChannelLinkConfig defines the configuration for the channel link.
CircuitFwdActions represents the forwarding decision made by the circuit map, and is returned from CommitCircuits.
CircuitMapConfig houses the critical interfaces and references necessary to parameterize an instance of circuitMap.
Config defines the configuration for the service.
DecayedLog implements the PersistLog interface.
DecodeHopIteratorRequest encapsulates all date necessary to process an onion packet, perform sphinx replay detection, and schedule the entry for garbage collection.
DecodeHopIteratorResponse encapsulates the outcome of a batched sphinx onion processing.
ForwardingError wraps an lnwire.FailureMessage in a struct that also includes the source of the error.
ForwardingInfo contains all the information that is necessary to forward and incoming HTLC to the next hop encoded within a valid HopIterator instance.
ForwardingPolicy describes the set of constraints that a given ChannelLink is to adhere to when forwarding HTLC's.
Keystone is a tuple binding an incoming and outgoing CircuitKey.
LinkFailureError encapsulates an error that will make us fail the current link.
OnionProcessor is responsible for keeping all sphinx dependent parts inside and expose only decoding function.
PaymentCircuit is used by the switch as placeholder between when the switch makes a forwarding decision and the outgoing link determines the proper HTLC ID for the local log.
SphinxErrorDecrypter wraps the sphinx data SphinxErrorDecrypter and maps the returned errors to concrete lnwire.FailureMessage instances.
SphinxErrorEncrypter is a concrete implementation of both the ErrorEncrypter interface backed by an implementation of the Sphinx packet format.
Switch is the central messaging bus for all incoming/outgoing HTLCs.

# Interfaces

ChannelLink is an interface which represents the subsystem for managing the incoming htlc requests, applying the changes to the channel, and also propagating/forwarding it to htlc switch.
CircuitMap is an interface for managing the construction and teardown of payment circuits used by the switch.
CircuitModifier is a common interface used by channel links to modify the contents of the circuit map maintained by the switch.
ErrorDecrypter is an interface that is used to decrypt the onion encrypted failure reason an extra out a well formed error.
ErrorEncrypter is an interface that is used to encrypt HTLC related errors at the source of the error, and also at each intermediate hop all the way back to the source of the payment.
ForwardingLog is an interface that represents a time series database which keep track of all successfully completed payment circuits.
HopIterator is an interface that abstracts away the routing information included in HTLC's which includes the entirety of the payment path of an HTLC.
InvoiceDatabase is an interface which represents the persistent subsystem which may search, lookup and settle invoices.
MailBox is an interface which represents a concurrent-safe, in-order delivery queue for messages from the network and also from the main switch.
Peer is an interface which represents the remote lightning node inside our system.
Sequencer emits sequence numbers for locally initiated HTLCs.
Ticker is an interface used to wrap a time.Ticker in a struct, making mocking it easier.

# Type aliases

ChannelCloseType is an enum which signals the type of channel closure the peer should execute.
CircuitKey is a tuple of channel ID and HTLC ID, used to uniquely identify HTLCs in a circuit.
EncrypterType establishes an enum used in serialization to indicate how to decode a concrete instance of the ErrorEncrypter interface.
ErrorEncrypterExtracter defines a function signature that extracts an ErrorEncrypter from an sphinx OnionPacket.
NetworkHop indicates the blockchain network that is intended to be the next hop for a forwarded HTLC.
UnknownEncrypterType is an error message used to signal that an unexpected EncrypterType was encountered during decoding.