multi: extract address source into interface

As a preparation to have the method for querying the addresses of a node
separate from the channel state, we extract that method out into its own
interface.
This commit is contained in:
Oliver Gugger committed 2021-09-29 17:00:03 +02:00
1 parent c1f686f860
commit ddea833d31
4 files changed
+29 -16

No files matched your search

+6 -1
View File
@@ -224,6 +224,8 @@ type server struct {
chanStateDB *channeldb.DB
addrSource chanbackup.AddressSource
htlcSwitch *htlcswitch.Switch
interceptableSwitch *htlcswitch.InterceptableSwitch
@@ -433,6 +435,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
cfg: cfg,
graphDB: dbs.graphDB.ChannelGraph(),
chanStateDB: dbs.chanStateDB,
addrSource: dbs.chanStateDB,
cc: cc,
sigPool: lnwallet.NewSigPool(cfg.Workers.Sig, cc.Signer),
writePool: writePool,
@@ -1246,7 +1249,9 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
addrs: s.chanStateDB,
}
backupFile := chanbackup.NewMultiFile(cfg.BackupFilePath)
startingChans, err := chanbackup.FetchStaticChanBackups(s.chanStateDB)
startingChans, err := chanbackup.FetchStaticChanBackups(
s.chanStateDB, s.addrSource,
)
if err != nil {
return nil, err
}