autopilot: split channel definition into LocalChannel/ChannelEdge

Since non-local channels won't have a balance field, we split the
definitions in anticipation of adding one.
This commit is contained in:
Johan T. Halseth committed 2020-10-05 12:24:07 +02:00
1 parent 3e1755ee99
commit d40cf6b592
14 files changed
+66 -72

No files matched your search

+3 -3
View File
@@ -249,7 +249,7 @@ func initAutoPilot(svr *server, cfg *lncfg.AutoPilot,
return &autopilot.ManagerCfg{
Self: self,
PilotCfg: &pilotCfg,
ChannelState: func() ([]autopilot.Channel, error) {
ChannelState: func() ([]autopilot.LocalChannel, error) {
// We'll fetch the current state of open
// channels from the database to use as initial
// state for the auto-pilot agent.
@@ -257,10 +257,10 @@ func initAutoPilot(svr *server, cfg *lncfg.AutoPilot,
if err != nil {
return nil, err
}
chanState := make([]autopilot.Channel,
chanState := make([]autopilot.LocalChannel,
len(activeChannels))
for i, channel := range activeChannels {
chanState[i] = autopilot.Channel{
chanState[i] = autopilot.LocalChannel{
ChanID: channel.ShortChanID(),
Capacity: channel.Capacity,
Node: autopilot.NewNodeID(