package
0.18.4-beta.rc2
Repository: https://github.com/lightningnetwork/lnd.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
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.
NewBoltBackendCreator returns a function that creates a new bbolt backend for the decayed logs database.
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.
NewDetailedLinkError returns a link error that enriches a wire message with a failure detail.
NewForwardingError creates a new payment error which wraps a wire error with additional metadata.
NewHtlcNotifier creates a new HtlcNotifier which gets htlc forwarded, failed and settled events from links our node has established with peers and sends notifications to subscribing clients.
NewInterceptableSwitch returns an instance of InterceptableSwitch.
NewLinkError returns a LinkError with the failure message provided.
NewMockObfuscator initializes a dummy mockObfuscator used for testing.
NewPersistentSequencer initializes a new sequencer using a channeldb backend.
NewUnknownForwardingError returns a forwarding error which has a nil failure message.
UseLogger uses a specified Logger to output package logging info.

# Constants

DefaultAckInterval is the duration between attempts to ack any settle fails in a forwarding package.
DefaultFwdEventInterval is the duration between attempts to flush pending forwarding events to disk.
DefaultLogInterval is the duration between attempts to log statistics about forwarding events.
DefaultMailboxDeliveryTimeout is the duration after which Adds will be cancelled if they could not get added to an outgoing commitment.
DefaultMaxLinkFeeAllocation is the highest allocation we'll allow a channel's commitment fee to be of its balance.
DefaultMaxLinkFeeUpdateTimeout represents the maximum interval in which a link should propose to update its commitment fee rate.
DefaultMaxOutgoingCltvExpiry is the maximum outgoing time lock that the node accepts for forwarded payments.
DefaultMinLinkFeeUpdateTimeout represents the minimum interval in which a link should propose to update its commitment fee rate.
ErrCircuitError indicates a duplicate keystone error was hit in the circuit map.
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.
ErrRecoveryError the channel was unable to be resumed, we need the remote party to force close the channel out on chain now as a result.
ErrRemoteError indicates that our peer sent an error, prompting up to fail the link.
ErrRemoteUnresponsive indicates that our peer took too long to complete a commitment dance.
ErrSyncError indicates that we failed synchronizing the state of the channel with our peer.
FwdActionFail fails the intercepted packet back to the sender.
FwdActionResume forwards the intercepted packet to the switch.
FwdActionResumeModified forwards the intercepted packet to the switch with modifications.
FwdActionSettle settles the intercepted packet with a preimage.
HtlcEventTypeForward represents a htlc that was forwarded through our node.
HtlcEventTypeReceive represents a htlc that was part of a receive to our node.
HtlcEventTypeSend represents a htlc that was part of a send from our node.
Incoming is the direction from the remote peer to our node.
LinkFailureDisconnect indicates that we should disconnect in an attempt to recycle the connection.
LinkFailureForceClose indicates that the channel should be force closed.
LinkFailureForceNone indicates no action is to be taken.
Outgoing is the direction from our node to the remote peer.
OutgoingFailureCircularRoute is returned when an attempt is made to forward a htlc through our node which arrives and leaves on the same channel.
OutgoingFailureDecodeError indicates that we could not decode the failure reason provided for a failed payment.
OutgoingFailureDownstreamHtlcAdd is returned when we fail to add a downstream htlc to our outgoing link.
OutgoingFailureForwardsDisabled is returned when the switch is configured to disallow forwards.
OutgoingFailureHTLCExceedsMax is returned when a htlc exceeds our policy's maximum htlc amount.
OutgoingFailureIncompleteForward is returned when we cancel an incomplete forward.
OutgoingFailureInsufficientBalance is returned when we cannot route a htlc due to insufficient outgoing capacity.
OutgoingFailureLinkNotEligible indicates that a routing attempt was made over a link that is not eligible for routing.
OutgoingFailureNone is returned when the wire message contains sufficient information.
OutgoingFailureOnChainTimeout indicates that a payment had to be timed out on chain before it got past the first hop by us or the remote party.

# Variables

DefaultMaxFeeExposure is the default threshold after which we'll fail payments if they increase our fee exposure.
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.
ErrFwdNotExists is an error returned when the caller tries to resolve a forward that doesn't exist anymore.
ErrLinkFailedShutdown signals that a requested shutdown failed.
ErrLinkShuttingDown signals that the link is shutting down.
ErrLocalAddFailed signals that the ADD htlc for a local payment failed to be processed.
ErrMailBoxShuttingDown is returned when the mailbox is interrupted by a shutdown request.
ErrNoLinksFound is an error returned when we attempt to retrieve the active links in the switch for a specific destination.
ErrPacketAlreadyExists signals that an attempt to add a packet failed because it already exists in the mailbox.
ErrPaymentIDAlreadyExists is returned if we try to write a pending payment whose paymentID already exists.
ErrPaymentIDNotFound is an error returned if the given paymentID is not found.
ErrSequencerCorrupted signals that the persistence engine was not initialized, or has been corrupted since startup.
ErrSwitchExiting signaled when the switch has received a shutdown request.
ErrUnknownCircuit signals that circuit could not be removed from the map because it was not found.
ErrUnknownErrorDecryptor signals that we were unable to locate the error decryptor for this payment.
ErrUnknownKeystone signals that no circuit was found using the outgoing circuit key.
ErrUnreadableFailureMessage is returned when the failure message cannot be decrypted.
ErrUnsupportedFailureCode when processing of an unsupported failure code is attempted.

# Structs

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.
No description provided by the author
ForwardingError wraps an lnwire.FailureMessage in a struct that also includes the source of the error.
ForwardingEvent represents a htlc that was forwarded onwards from our node.
ForwardingFailEvent represents a htlc failure which occurred down the line after we forwarded a htlc onwards.
FwdResolution defines the action to be taken on an intercepted packet.
HtlcInfo provides the details of a htlc that our node has processed.
HtlcKey uniquely identifies the htlc.
HtlcNotifier notifies clients of htlc forwards, failures and settles for htlcs that the switch handles.
InterceptableSwitch is an implementation of ForwardingSwitch interface.
InterceptableSwitchConfig contains the configuration of InterceptableSwitch.
InterceptedPacket contains the relevant information for the interceptor about an HTLC.
Keystone is a tuple binding an incoming and outgoing CircuitKey.
LinkError is an implementation of the ClearTextError interface which represents failures that occur on our incoming or outgoing link.
LinkFailEvent describes a htlc that failed on our incoming or outgoing link.
LinkFailureError encapsulates an error that will make us fail the current link.
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.
PaymentResult wraps a decoded result received from the network after a payment attempt was made.
SettleEvent represents a htlc that was settled.
SphinxErrorDecrypter wraps the sphinx data SphinxErrorDecrypter and maps the returned errors to concrete lnwire.FailureMessage instances.
Switch is the central messaging bus for all incoming/outgoing HTLCs.

# Interfaces

AuxHtlcModifier is an interface that allows the sender to modify the outgoing HTLC of a payment by changing the amount or the wire message tlv records.
AuxTrafficShaper is an interface that allows the sender to determine if a payment should be carried by a channel based on the TLV records that may be present in the `update_add_htlc` message or the channel commitment itself.
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.
ChannelUpdateHandler is an interface that provides methods that allow sending lnwire.Message to the underlying link as well as querying state.
CircuitLookup is a common interface used to lookup information that is stored in the circuit map.
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.
ClearTextError is an interface which is implemented by errors that occur when we know the underlying wire failure message.
ErrorDecrypter is an interface that is used to decrypt the onion encrypted failure reason an extra out a well formed error.
FailureDetail is an interface implemented by failures that occur on our incoming or outgoing link, or within the switch itself.
ForwardingLog is an interface that represents a time series database which keep track of all successfully completed payment circuits.
InterceptableHtlcForwarder is the interface to set the interceptor implementation that intercepts htlc forwards.
InterceptedForward is passed to the ForwardInterceptor for every forwarded 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.
OnionErrorDecrypter is the interface that provides onion level error decryption.
Sequencer emits sequence numbers for locally initiated HTLCs.
TowerClient is the primary interface used by the daemon to backup pre-signed justice transactions to watchtowers.

# Type aliases

CircuitKey is a tuple of channel ID and HTLC ID, used to uniquely identify HTLCs in a circuit.
CommitHookID is a value that is used to uniquely identify hooks in the ChannelUpdateHandler's commitment update lifecycle.
FlushHookID is a value that is used to uniquely identify hooks in the ChannelUpdateHandler's flush lifecycle.
ForwardInterceptor is a function that is invoked from the switch for every incoming htlc that is intended to be forwarded.
FwdAction defines the various resolution types.
HtlcEventType represents the type of event that a htlc was part of.
LinkDirection is used to query and change any link state on a per-direction basis.
LinkFailureAction is an enum-like type that describes the action that should be taken in response to a link failure.
OutgoingFailure is an enum which is used to enrich failures which occur in the switch or on our outgoing link with additional metadata.
UnknownEncrypterType is an error message used to signal that an unexpected EncrypterType was encountered during decoding.