diff --git a/autopilot/agent.go b/autopilot/agent.go index 8e625c14..2fe123c9 100644 --- a/autopilot/agent.go +++ b/autopilot/agent.go @@ -584,6 +584,7 @@ func (a *Agent) openChans(availableFunds btcutil.Amount, numChans uint32, // Use the heuristic to calculate a score for each node in the // graph. + log.Debugf("Scoring %d nodes for chan_size=%v", len(nodes), chanSize) scores, err := a.cfg.Heuristic.NodeScores( a.cfg.Graph, totalChans, chanSize, nodes, ) diff --git a/autopilot/interface.go b/autopilot/interface.go index 34ef7597..b63661e3 100644 --- a/autopilot/interface.go +++ b/autopilot/interface.go @@ -188,10 +188,11 @@ func init() { // open a channel within the graph to a target peer, close targeted channels, // or add/remove funds from existing channels via a splice in/out mechanisms. type ChannelController interface { - // OpenChannel opens a channel to a target peer, with a capacity of the - // specified amount. This function should un-block immediately after - // the funding transaction that marks the channel open has been - // broadcast. + // OpenChannel opens a channel to a target peer, using at most amt + // funds. This means that the resulting channel capacity might be + // slightly less to account for fees. This function should un-block + // immediately after the funding transaction that marks the channel + // open has been broadcast. OpenChannel(target *btcec.PublicKey, amt btcutil.Amount) error // CloseChannel attempts to close out the target channel. diff --git a/pilot.go b/pilot.go index 5748cf97..9a0f402c 100644 --- a/pilot.go +++ b/pilot.go @@ -100,6 +100,7 @@ func (c *chanController) OpenChannel(target *btcec.PublicKey, req := &openChanReq{ targetPubkey: target, chainHash: *activeNetParams.GenesisHash, + subtractFees: true, localFundingAmt: amt, pushAmt: 0, minHtlc: minHtlc,