autopilot: rename to Capacity to Balance, define ChannelInfo()

We rename the field Capacity on local channels to Balance, define a new
method ChannelInfo on the manager config that let us query the database
for our latest channels state. Using this we will use the current local
balance instead of the channel capacity when doing allocation
calculations.
This commit is contained in:
Johan T. Halseth
2020-10-02 14:49:02 +02:00
parent d40cf6b592
commit dbeafe8832
7 changed files with 70 additions and 48 deletions

View File

@@ -100,7 +100,7 @@ func (h *agentConstraints) ChannelBudget(channels []LocalChannel,
// present within the set of active channels.
var totalChanAllocation btcutil.Amount
for _, channel := range channels {
totalChanAllocation += channel.Capacity
totalChanAllocation += channel.Balance
}
// With this value known, we'll now compute the total amount of fund