package
0.0.3
Repository: https://github.com/bittap-protocol/lnd.git
Documentation: pkg.go.dev

# README

routing

Build Status MIT licensed GoDoc

The routing package implements authentication+validation of channel announcements, pruning of the channel graph, path finding within the network, sending outgoing payments into the network and synchronizing new peers to our channel graph state.

Installation and Updating

$  go get -u github.com/lightningnetwork/lnd/routing

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

DefaultAprioriConfig returns the default configuration for the estimator.
DefaultBimodalConfig returns the default configuration for the estimator.
DisableLog disables all library log output.
EncodeHexColor takes a color and returns it in hex code format.
IsError is a helper function which is needed to have ability to check that returned error has specific error code.
New creates a new instance of the ChannelRouter with the specified configuration parameters.
NewAprioriEstimator creates a new AprioriEstimator.
NewBimodalEstimator creates a new BimodalEstimator.
NewCachedGraph instantiates a new db-connected routing graph.
NewControlTower creates a new instance of the controlTower.
NewDirectedNodePair instantiates a new DirectedNodePair struct.
NewMissionControl returns a new instance of missionControl.
NewRouteRequest produces a new route request for a regular payment or one to a blinded route, validating that the target, routeHints and finalExpiry parameters are mutually exclusive with the blindedPayment parameter (which contains these values for blinded payments).
NewValidationBarrier creates a new instance of a validation barrier given the total number of active requests, and a quit channel which will be used to know when to kill pending, but unfilled jobs.
RouteHintsToEdges converts a list of invoice route hints to an edge map that can be passed into pathfinding.
UseLogger uses a specified Logger to output package logging info.
ValidateChannelAnn validates the channel announcement message and checks that node signatures covers the announcement message, and that the bitcoin signatures covers the node keys.
ValidateChannelUpdateAnn validates the channel update announcement by checking (1) that the included signature covers the announcement and has been signed by the node's private key, and (2) that the announcement's message flags and optional fields are sane.
ValidateChannelUpdateFields validates a channel update's message flags and corresponding update fields.
ValidateCLTVLimit is a helper function that validates that the cltv limit is greater than the final cltv delta parameter, optionally including the BlockPadding in this calculation.
ValidateNodeAnn validates the node announcement by ensuring that the attached signature is needed a signature of the node announcement under the specified node public key.
VerifyChannelUpdateSignature verifies that the channel update message was signed by the party with the given node public key.

# Constants

AprioriEstimatorName is used to identify the apriori probability estimator.
BimodalEstimatorName is used to identify the bimodal estimator.
BimodalScaleMsatMax is the maximum value for BimodalScaleMsat.
BlockPadding is used to increment the finalCltvDelta value for the last hop to prevent an HTLC being failed if some blocks are mined while it's in-flight.
DefaultAprioriWeight is the default a priori weight.
DefaultBimodalDecayTime is the default value for BimodalDecayTime.
DefaultBimodalNodeWeight is the default value for the BimodalNodeWeight in BimodalConfig.
DefaultBimodalScaleMsat is the default value for BimodalScaleMsat in BimodalConfig.
DefaultCapacityFraction is the default value for CapacityFraction.
DefaultChannelPruneExpiry is the default duration used to determine if a channel should be pruned or not.
DefaultFeeEstimationTimeout is the default value for FeeEstimationTimeout.
DefaultFirstTimePruneDelay is the time we'll wait after startup before attempting to prune the graph for zombie channels.
DefaultMaxMcHistory is the default maximum history size.
DefaultMcFlushInterval is the default interval we use to flush MC state to the database.
DefaultMinFailureRelaxInterval is the default minimum time that must have passed since the previously recorded failure before the failure amount may be raised.
DefaultPayAttemptTimeout is the default payment attempt timeout.
DefaultPenaltyHalfLife is the default half-life duration.
ErrChannelSpent is returned when we go to validate a channel, but the purported funding output has actually already been spent on chain.
ErrIgnored is returned when the update have been ignored because this update can't bring us something new, or because a node announcement was given for node not found in any channel.
ErrInvalidFundingOutput is returned if the channel funding output fails validation.
ErrNoFundingTransaction is returned when we are unable to find the funding transaction described by the short channel ID on chain.
ErrOutdated is returned when the routing update already have been applied, or a newer update is already known.
ErrParentValidationFailed signals that the validation of a dependent's parent failed, so the dependent must not be processed.
ErrVBarrierShuttingDown signals that the barrier has been requested to shutdown, and that the caller should not treat the wait condition as fulfilled.
MaxCLTVDelta is the maximum CLTV value accepted by LND for all timelock deltas.
MinCLTVDelta is the minimum CLTV value accepted by LND for all timelock deltas.
RiskFactorBillionths controls the influence of time lock delta of a channel on route selection.
No description provided by the author

# Variables

DefaultAprioriHopProbability is the default a priori probability for a hop.
DefaultAttemptCost is the default fixed virtual cost in path finding of a failed payment attempt.
DefaultAttemptCostPPM is the default proportional virtual cost in path finding weight units of executing a payment attempt that fails.
DefaultEstimator is the default estimator used for computing probabilities in pathfinding.
DefaultMinRouteProbability is the default minimum probability for routes returned from findPath.
DefaultShardMinAmt is the default amount beyond which we won't try to further split the payment if no route is found.
ErrExpiryAndBlinded is returned if a final cltv and a blinded path are provided, as the cltv should be provided within the blinded path.
ErrHintsAndBlinded is returned if a route request has both bolt 11 route hints and a blinded path set.
ErrHTLCRestrictions is returned when a blinded path has invalid HTLC maximum and minimum values.
ErrInsufficientBlindedHops is returned when a blinded path does not have enough blinded hops.
ErrInvalidAprioriWeight is returned when we get an apriori weight that is out of range.
ErrInvalidCapacityFraction is returned when we get a capacity fraction that is out of range.
ErrInvalidDecayTime is returned when we get a decay time below zero.
ErrInvalidFailureInterval is returned if we get an invalid failure interval.
ErrInvalidHalflife is returned when we get an invalid half life.
ErrInvalidHopProbability is returned when we get an invalid hop probability.
ErrInvalidMcHistory is returned if we get a negative mission control history count.
ErrInvalidNodeWeight is returned when we get a node weight that is out of range.
ErrInvalidScale is returned when we get a scale below or equal zero.
ErrNoBlindedPath is returned when the blinded path in a blinded payment is missing.
ErrNoPayLoadSizeFunc is returned when no payload size function is definied.
ErrNoTarget is returned when the target node for a route is not provided by either a blinded route or a cleartext pubkey.
ErrPaymentLifecycleExiting is used when waiting for htlc attempt result, but the payment lifecycle is exiting .
ErrRouterShuttingDown is returned if the router is in the process of shutting down.
ErrSelfIntro is a failure returned when the source node of a route request is also the introduction node.
ErrSkipTempErr is returned when a non-MPP is made yet the skipTempErr flag is set.
ErrTargetAndBlinded is returned is a target destination and a blinded path are both set (as the target is inferred from the blinded path).
ErrZeroCapacity is returned when we encounter a channel with zero capacity in probability estimation.

# Structs

AMPOptions houses information that must be known in order to send an AMP payment.
AprioriConfig contains configuration for our probability estimator.
AprioriEstimator returns node and pair probabilities based on historical payment results.
BimodalConfig contains configuration for our probability estimator.
BimodalEstimator returns node and pair probabilities based on historical payment results based on a liquidity distribution model of the LN.
BlindedEdge implements the AdditionalEdge interface.
BlindedPayment provides the path and payment parameters required to send a payment along a blinded path.
CachedGraph is a routingGraph implementation that retrieves from the database.
ChannelEdgeUpdate is an update for a new channel within the ChannelGraph.
ChannelPolicy holds the parameters that determine the policy we enforce when forwarding payments on a channel.
ChannelRouter is the layer 3 router within the Lightning stack.
ClosedChanSummary is a summary of a channel that was detected as being closed by monitoring the blockchain.
Config defines the configuration for the ChannelRouter.
DirectedNodePair stores a directed pair of nodes.
EdgeLocator is a struct used to identify a specific edge.
ErrNoChannel is returned when a route cannot be built because there are no channels that satisfy all requirements.
FeeSchema is the set fee configuration for a Lightning Node on the network.
LightningPayment describes a payment to be sent through the network to the final destination.
MissionControl contains state which summarizes the past attempts of HTLC routing by external callers when sending payments throughout the network.
MissionControlConfig defines parameters that control mission control behaviour.
MissionControlPairSnapshot contains a snapshot of the current node pair state in mission control.
MissionControlSnapshot contains a snapshot of the current state of mission control.
NetworkNodeUpdate is an update for a node within the Lightning Network.
PathFindingConfig defines global parameters that control the trade-off in path finding between fees and probability.
PrivateEdge implements the AdditionalEdge interface.
RestrictParams wraps the set of restrictions passed to findPath that the found path must adhere to.
RouteRequest contains the parameters for a pathfinding request.
SessionSource defines a source for the router to retrieve new payment sessions.
TimedPairResult describes a timestamped pair result.
TopologyChange represents a new set of modifications to the channel graph.
TopologyClient represents an intent to receive notifications from the channel router regarding changes to the topology of the channel graph.
ValidationBarrier is a barrier used to ensure proper validation order while concurrently validating new announcements for channel edges, and the attributes of channel edges.

# Interfaces

AdditionalEdge is an interface which specifies additional edges which can be appended to an existing route.
ChannelGraphSource represents the source of information about the topology of the lightning network.
ControlTower tracks all outgoing payments made, whose primary purpose is to prevent duplicate payments to the same payment hash.
ControlTowerSubscriber contains the state for a payment update subscriber.
Estimator estimates the probability to reach a node.
MissionController is an interface that exposes failure reporting and probability estimation.
PaymentAttemptDispatcher is used by the router to send payment attempts onto the network, and receive their results.
PaymentSession is used during SendPayment attempts to provide routes to attempt.
PaymentSessionSource is an interface that defines a source for the router to retrieve new payment sessions.

# Type aliases

NodeResults contains previous results from a node to its peers.
PayloadSizeFunc defines the interface for the payload size function.
RouteHints is an alias type for a set of route hints, with the source node as the map's key and the details of the hint(s) in the edge policy.