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
2021-09-21 19:18:16 +02:00
parent c1f686f860
commit ddea833d31
4 changed files with 29 additions and 16 deletions

View File

@ -6469,7 +6469,7 @@ func (r *rpcServer) ExportChannelBackup(ctx context.Context,
// the database. If this channel has been closed, or the outpoint is
// unknown, then we'll return an error
unpackedBackup, err := chanbackup.FetchBackupForChan(
chanPoint, r.server.chanStateDB,
chanPoint, r.server.chanStateDB, r.server.addrSource,
)
if err != nil {
return nil, err
@ -6639,7 +6639,7 @@ func (r *rpcServer) ExportAllChannelBackups(ctx context.Context,
// First, we'll attempt to read back ups for ALL currently opened
// channels from disk.
allUnpackedBackups, err := chanbackup.FetchStaticChanBackups(
r.server.chanStateDB,
r.server.chanStateDB, r.server.addrSource,
)
if err != nil {
return nil, fmt.Errorf("unable to fetch all static chan "+
@ -6766,7 +6766,7 @@ func (r *rpcServer) SubscribeChannelBackups(req *lnrpc.ChannelBackupSubscription
// we'll obtains the current set of single channel
// backups from disk.
chanBackups, err := chanbackup.FetchStaticChanBackups(
r.server.chanStateDB,
r.server.chanStateDB, r.server.addrSource,
)
if err != nil {
return fmt.Errorf("unable to fetch all "+