contractcourt: ignore all other dispatch cases in closeObserver when recovered chan

In this commit, we modify the `closeObserver` to fast path the DLP
dispatch case if we detect that the channel has been restored. We do
this as otherwise, we may inadvertently enter one of the other cases
erroneously, causing us to now properly look up their dlp commitment
point.
This commit is contained in:
Olaoluwa Osuntokun committed 2019-03-28 17:54:00 -07:00
1 parent c722f2c064
commit 26f6fd7db2
2 files changed
+22 -21

No files matched your search

+4 -6
View File
@@ -2436,8 +2436,6 @@ func (r *rpcServer) ListChannels(ctx context.Context,
resp := &lnrpc.ListChannelsResponse{}
// TODO(roasbeef): expose chan status flags as well
graph := r.server.chanDB.ChannelGraph()
dbChannels, err := r.server.chanDB.FetchAllOpenChannels()
@@ -4686,17 +4684,17 @@ func (r *rpcServer) ForwardingHistory(ctx context.Context,
// once lnd is running, or via the InitWallet and UnlockWallet methods from the
// WalletUnlocker service.
func (r *rpcServer) ExportChannelBackup(ctx context.Context,
in *lnrpc.ChannelPoint) (*lnrpc.ChannelBackup, error) {
in *lnrpc.ExportChannelBackupRequest) (*lnrpc.ChannelBackup, error) {
// First, we'll convert the lnrpc channel point into a wire.OutPoint
// that we can manipulate.
txid, err := getChanPointFundingTxid(in)
txid, err := getChanPointFundingTxid(in.ChanPoint)
if err != nil {
return nil, err
}
chanPoint := wire.OutPoint{
Hash: *txid,
Index: in.OutputIndex,
Index: in.ChanPoint.OutputIndex,
}
// Next, we'll attempt to fetch a channel backup for this channel from
@@ -4730,7 +4728,7 @@ func (r *rpcServer) ExportChannelBackup(ctx context.Context,
}
return &lnrpc.ChannelBackup{
ChanPoint: in,
ChanPoint: in.ChanPoint,
ChanBackup: packedBackup,
}, nil
}