Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lightning_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3138,6 +3138,10 @@ func (p *PendingCloseUpdate) CloseTxid() chainhash.Hash {
type ChannelClosedUpdate struct {
// CloseTx is the closing transaction id.
CloseTx chainhash.Hash

// NumPendingHtlcs is the number of pending htlcs that we have
// present while a channel close with the NoWait option was in progress.
NumPendingHtlcs int32
}

// CloseTxid returns the closing txid of the channel.
Expand Down Expand Up @@ -3291,6 +3295,21 @@ func (s *lightningClient) CloseChannel(ctx context.Context,
}
sendUpdate(closeUpdate)

case *lnrpc.CloseStatusUpdate_CloseInstant:
instantUpdate := update.CloseInstant
if instantUpdate == nil {
sendErr(errors.New("instant update " +
"unavailable"))

return
}

numPendingHtlcs := instantUpdate.NumPendingHtlcs
closeUpdate := &ChannelClosedUpdate{
NumPendingHtlcs: numPendingHtlcs,
}
sendUpdate(closeUpdate)

default:
sendErr(fmt.Errorf("unknown channel close "+
"update: %T", resp.Update))
Expand Down