mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-03 18:22:25 +02:00
autopilot: for ConstrainedPrefAttachment.Select factor in skipNodes
This commit modifies the Select method for the ConstrainedPrefAttachment attachment heuristic slightly. Previously, it was possible for an autopilot.Agent to go over the allotted number of channels as it would unconditionally attempt to establish channel with all returned Attachment Directives. To remedy this, we now assume that we already have active, or pending channels to each of the nodes in the set of skipNodes. Therefore, we now use the size of the skipNodes map as an upper limit within the primary selection loop.
This commit is contained in:
@@ -112,6 +112,8 @@ type AttachmentHeuristic interface {
|
||||
// indeed need more channels, then the second argument returned will
|
||||
// represent the amount of additional funds to be used towards creating
|
||||
// channels.
|
||||
//
|
||||
// TODO(roasbeef): return number of chans? ensure doesn't go over
|
||||
NeedMoreChans(chans []Channel, balance btcutil.Amount) (btcutil.Amount, bool)
|
||||
|
||||
// Select is a method that given the current state of the channel
|
||||
|
Reference in New Issue
Block a user