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
2024-01-10 15:43:26 -08:00
parent ec55831229
commit 804dabb4ea
5 changed files with 3270 additions and 3147 deletions

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)