Skip to content

Commit aa84676

Browse files
committed
lndclient: add channel update events
1 parent 506b2c5 commit aa84676

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

lightning_client.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,10 @@ const (
609609
// FullyResolvedChannelUpdate indicates that the channel event holds
610610
// information about a channel has been fully closed.
611611
FullyResolvedChannelUpdate
612+
613+
// StateChannelUpdate indicates that the channel has updated state or
614+
// parameters.
615+
StateChannelUpdate
612616
)
613617

614618
// OpenStatusUpdate is a wrapper for channel status updates following a channel
@@ -649,6 +653,9 @@ type ChannelEventUpdate struct {
649653

650654
// ClosedChannelInfo holds the channel info for a newly closed channel.
651655
ClosedChannelInfo *ClosedChannel
656+
657+
// ChannelParamsUpdate holds updates to channel parameters.
658+
ChannelParamsUpdate *ChannelInfo
652659
}
653660

654661
// ClosedChannel represents a channel that has been closed.
@@ -2834,6 +2841,17 @@ func (s *lightningClient) getChannelEventUpdate(
28342841
return nil, err
28352842
}
28362843

2844+
case lnrpc.ChannelEventUpdate_CHANNEL_UPDATE:
2845+
result.UpdateType = StateChannelUpdate
2846+
channel := rpcChannelEventUpdate.GetUpdatedChannel()
2847+
2848+
result.ChannelParamsUpdate, err = s.newChannelInfo(
2849+
channel.Channel,
2850+
)
2851+
if err != nil {
2852+
return nil, err
2853+
}
2854+
28372855
default:
28382856
return nil, fmt.Errorf("unhandled update type: %v",
28392857
rpcChannelEventUpdate.Type.String())

0 commit comments

Comments
 (0)