autopilot: use subtractFees when funding channel

To make the autopilot able to account for fees, we let it use the
subtractFees option when opening channels.

This makes sure that each channel we attempt to open will eat at most
Amt out of our budget. Previously fees would eat into our funds in
addition, causing us to deplete our funds more than expected on each
channel opening.
This commit is contained in:
Johan T. Halseth committed 2019-07-18 00:58:12 +02:00
1 parent 0405703019
commit bf7f392c11
3 files changed
+7 -4

No files matched your search

+1
View File
@@ -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,
)