lnd: make closechannel send an instant empty update when no_wait set

We do things this way to keep behavior consistent across REST, gRPC
and CLI consistent. This was done to not alter the way we handle
Recv calls from the streams.
This commit is contained in:
Keagan McClelland committed 2024-01-23 12:25:01 -08:00
1 parent ec55831229
commit 804dabb4ea
5 files changed
+3270 -3147

No files matched your search

+4
View File
@@ -921,6 +921,10 @@ func executeChannelClose(ctxc context.Context, client lnrpc.LightningClient,
}
switch update := resp.Update.(type) {
case *lnrpc.CloseStatusUpdate_CloseInstant:
if req.NoWait {
return nil
}
case *lnrpc.CloseStatusUpdate_ClosePending:
closingHash := update.ClosePending.Txid
txid, err := chainhash.NewHash(closingHash)