mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-09 20:32:38 +02:00
Merge pull request #3993 from guggero/unconfirmed-chanbackup
chanbackup: update on-disk backup file with unconfirmed channels
This commit is contained in:
13
rpcserver.go
13
rpcserver.go
@@ -2253,6 +2253,10 @@ func (r *rpcServer) AbandonChannel(ctx context.Context,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Finally, notify the backup listeners that the channel can be removed
|
||||
// from any channel backups.
|
||||
r.server.channelNotifier.NotifyClosedChannelEvent(*chanPoint)
|
||||
|
||||
return &lnrpc.AbandonChannelResponse{}, nil
|
||||
}
|
||||
|
||||
@@ -5711,7 +5715,7 @@ func (r *rpcServer) SubscribeChannelBackups(req *lnrpc.ChannelBackupSubscription
|
||||
updateStream lnrpc.Lightning_SubscribeChannelBackupsServer) error {
|
||||
|
||||
// First, we'll subscribe to the primary channel notifier so we can
|
||||
// obtain events for new opened/closed channels.
|
||||
// obtain events for new pending/opened/closed channels.
|
||||
chanSubscription, err := r.server.channelNotifier.SubscribeChannelEvents()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -5728,9 +5732,10 @@ func (r *rpcServer) SubscribeChannelBackups(req *lnrpc.ChannelBackupSubscription
|
||||
switch e.(type) {
|
||||
|
||||
// We only care about new/closed channels, so we'll
|
||||
// skip any events for pending/active/inactive channels.
|
||||
case channelnotifier.PendingOpenChannelEvent:
|
||||
continue
|
||||
// skip any events for active/inactive channels.
|
||||
// To make the subscription behave the same way as the
|
||||
// synchronous call and the file based backup, we also
|
||||
// include pending channels in the update.
|
||||
case channelnotifier.ActiveChannelEvent:
|
||||
continue
|
||||
case channelnotifier.InactiveChannelEvent:
|
||||
|
Reference in New Issue
Block a user