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:
3 files changed
+7
-4
No files matched your search
@@ -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,
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user