mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02:00
config+pilot: add flag to specify min confs for autopilot agent
This commit is contained in:
13
pilot.go
13
pilot.go
@ -17,8 +17,9 @@ import (
|
||||
// chanController is an implementation of the autopilot.ChannelController
|
||||
// interface that's backed by a running lnd instance.
|
||||
type chanController struct {
|
||||
server *server
|
||||
private bool
|
||||
server *server
|
||||
private bool
|
||||
minConfs int32
|
||||
}
|
||||
|
||||
// OpenChannel opens a channel to a target peer, with a capacity of the
|
||||
@ -48,6 +49,7 @@ func (c *chanController) OpenChannel(target *btcec.PublicKey,
|
||||
fundingFeePerKw: feePerKw,
|
||||
private: c.private,
|
||||
remoteCsvDelay: 0,
|
||||
minConfs: c.minConfs,
|
||||
}
|
||||
|
||||
updateStream, errChan := c.server.OpenChannel(req)
|
||||
@ -110,11 +112,12 @@ func initAutoPilot(svr *server, cfg *autoPilotConfig) (*autopilot.Agent, error)
|
||||
Self: self,
|
||||
Heuristic: prefAttachment,
|
||||
ChanController: &chanController{
|
||||
server: svr,
|
||||
private: cfg.Private,
|
||||
server: svr,
|
||||
private: cfg.Private,
|
||||
minConfs: cfg.MinConfs,
|
||||
},
|
||||
WalletBalance: func() (btcutil.Amount, error) {
|
||||
return svr.cc.wallet.ConfirmedBalance(1)
|
||||
return svr.cc.wallet.ConfirmedBalance(cfg.MinConfs)
|
||||
},
|
||||
Graph: autopilot.ChannelGraphFromDatabase(svr.chanDB.ChannelGraph()),
|
||||
MaxPendingOpens: 10,
|
||||
|
Reference in New Issue
Block a user