Skip to content

Commit 7296703

Browse files
committed
tapchannelmsg: parse missing channel data
1 parent 2e9bf9b commit 7296703

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

tapchannelmsg/custom_channel_data.go

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,60 @@ func ParseCustomChannelData(msg proto.Message) error {
451451
rpcChannel.CustomChannelData = customData
452452
}
453453

454+
for idx := range m.PendingForceClosingChannels {
455+
pendingForceClose := m.PendingForceClosingChannels[idx]
456+
rpcChannel := pendingForceClose.Channel
457+
458+
if rpcChannel == nil {
459+
continue
460+
}
461+
462+
customData, err := jsonFormatChannelCustomData(
463+
rpcChannel.CustomChannelData,
464+
)
465+
if err != nil {
466+
return err
467+
}
468+
469+
rpcChannel.CustomChannelData = customData
470+
}
471+
472+
for idx := range m.WaitingCloseChannels {
473+
waitingClose := m.WaitingCloseChannels[idx]
474+
rpcChannel := waitingClose.Channel
475+
476+
if rpcChannel == nil {
477+
continue
478+
}
479+
480+
customData, err := jsonFormatChannelCustomData(
481+
rpcChannel.CustomChannelData,
482+
)
483+
if err != nil {
484+
return err
485+
}
486+
487+
rpcChannel.CustomChannelData = customData
488+
}
489+
490+
case *lnrpc.ClosedChannelsResponse:
491+
for idx := range m.Channels {
492+
rpcChannel := m.Channels[idx]
493+
494+
if rpcChannel == nil {
495+
continue
496+
}
497+
498+
customData, err := jsonFormatChannelCustomData(
499+
rpcChannel.CustomChannelData,
500+
)
501+
if err != nil {
502+
return err
503+
}
504+
505+
rpcChannel.CustomChannelData = customData
506+
}
507+
454508
case *lnrpc.CloseStatusUpdate:
455509
closeUpd, ok := m.Update.(*lnrpc.CloseStatusUpdate_ChanClose)
456510
if !ok {

0 commit comments

Comments
 (0)