Merge pull request #10079 from guggero/funding-timeout-error
Add missing `FundingTimeoutEvent` type to `SubscribeChannelEvents` RPC
This commit is contained in:
6 files changed
+2180
-2128
No files matched your search
@@ -192,7 +192,7 @@ func (c *ChannelNotifier) NotifyFullyResolvedChannelEvent(
|
||||
}
|
||||
}
|
||||
|
||||
// NotifyFundingTimeoutEvent notifies the channelEventNotifier goroutine that
|
||||
// NotifyFundingTimeout notifies the channelEventNotifier goroutine that
|
||||
// a funding timeout has occurred for a certain channel point.
|
||||
func (c *ChannelNotifier) NotifyFundingTimeout(chanPoint wire.OutPoint) {
|
||||
// Send this event to all channel event subscribers.
|
||||
|
||||
@@ -46,6 +46,12 @@
|
||||
would not be able to decode persisted data in the utxo nursery and therefore
|
||||
would fail to start up.
|
||||
|
||||
- [Added the missing `FundingTimeoutEvent` event type to the
|
||||
`SubscribeChannelEvents`
|
||||
RPC](https://github.com/lightningnetwork/lnd/pull/10079) to avoid the
|
||||
`unexpected channel event update` error that lead to the termination of the
|
||||
streaming RPC call.
|
||||
|
||||
# New Features
|
||||
|
||||
## Functional Enhancements
|
||||
|
||||
+2152
-2126
File diff suppressed because it is too large.
Load diff
@@ -2973,6 +2973,7 @@ message ChannelEventUpdate {
|
||||
ChannelPoint inactive_channel = 4;
|
||||
PendingUpdate pending_open_channel = 6;
|
||||
ChannelPoint fully_resolved_channel = 7;
|
||||
ChannelPoint channel_funding_timeout = 8;
|
||||
}
|
||||
|
||||
enum UpdateType {
|
||||
@@ -2982,6 +2983,7 @@ message ChannelEventUpdate {
|
||||
INACTIVE_CHANNEL = 3;
|
||||
PENDING_OPEN_CHANNEL = 4;
|
||||
FULLY_RESOLVED_CHANNEL = 5;
|
||||
CHANNEL_FUNDING_TIMEOUT = 6;
|
||||
}
|
||||
|
||||
UpdateType type = 5;
|
||||
|
||||
@@ -3009,7 +3009,8 @@
|
||||
"ACTIVE_CHANNEL",
|
||||
"INACTIVE_CHANNEL",
|
||||
"PENDING_OPEN_CHANNEL",
|
||||
"FULLY_RESOLVED_CHANNEL"
|
||||
"FULLY_RESOLVED_CHANNEL",
|
||||
"CHANNEL_FUNDING_TIMEOUT"
|
||||
],
|
||||
"default": "OPEN_CHANNEL"
|
||||
},
|
||||
@@ -4480,6 +4481,9 @@
|
||||
"fully_resolved_channel": {
|
||||
"$ref": "#/definitions/lnrpcChannelPoint"
|
||||
},
|
||||
"channel_funding_timeout": {
|
||||
"$ref": "#/definitions/lnrpcChannelPoint"
|
||||
},
|
||||
"type": {
|
||||
"$ref": "#/definitions/ChannelEventUpdateUpdateType"
|
||||
}
|
||||
|
||||
@@ -5315,6 +5315,7 @@ func (r *rpcServer) SubscribeChannelEvents(req *lnrpc.ChannelEventSubscription,
|
||||
defer channelEventSub.Cancel()
|
||||
|
||||
for {
|
||||
//nolint:ll
|
||||
select {
|
||||
// A new update has been sent by the channel router, we'll
|
||||
// marshal it into the form expected by the gRPC client, then
|
||||
@@ -5410,6 +5411,19 @@ func (r *rpcServer) SubscribeChannelEvents(req *lnrpc.ChannelEventSubscription,
|
||||
},
|
||||
}
|
||||
|
||||
case channelnotifier.FundingTimeoutEvent:
|
||||
update = &lnrpc.ChannelEventUpdate{
|
||||
Type: lnrpc.ChannelEventUpdate_CHANNEL_FUNDING_TIMEOUT,
|
||||
Channel: &lnrpc.ChannelEventUpdate_ChannelFundingTimeout{
|
||||
ChannelFundingTimeout: &lnrpc.ChannelPoint{
|
||||
FundingTxid: &lnrpc.ChannelPoint_FundingTxidBytes{
|
||||
FundingTxidBytes: event.ChannelPoint.Hash[:],
|
||||
},
|
||||
OutputIndex: event.ChannelPoint.Index,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
default:
|
||||
return fmt.Errorf("unexpected channel event update: %v", event)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user