mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 07:35:07 +02:00
config+pilot: add new config params to specify min+max autopilot chan size
In this commit, we add two new configuration parameters to allow users to specify the min and max size that the autopilot agent will create. This is useful as now users can set the values to more or less the same size, which will allow them to control the size of each created channel. Before this commit, if this wasn’t set, then the agent would try to shove as much money into a channel up until the max chan size. This was nice on testnet, but on main net, users will likely not want all their funds to be in a single channel, and instead be distributed across many channels. With things like AMP, have more channels becomes more desirable.
This commit is contained in:
6
pilot.go
6
pilot.go
@@ -142,11 +142,9 @@ func initAutoPilot(svr *server, cfg *autoPilotConfig) (*autopilot.Agent, error)
|
||||
|
||||
// First, we'll create the preferential attachment heuristic,
|
||||
// initialized with the passed auto pilot configuration parameters.
|
||||
//
|
||||
// TODO(roasbeef): switch here to dispatch specified heuristic
|
||||
minChanSize := svr.cc.wallet.Cfg.DefaultConstraints.DustLimit * 5
|
||||
prefAttachment := autopilot.NewConstrainedPrefAttachment(
|
||||
minChanSize, maxFundingAmount,
|
||||
btcutil.Amount(cfg.MinChannelSize),
|
||||
btcutil.Amount(cfg.MaxChannelSize),
|
||||
uint16(cfg.MaxChannels), cfg.Allocation,
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user