multi: coop close with active HTLCs on the channel

For the lncli cmd we now always initiate the coop close even if
there are active HTLCs on the channel. In case HTLCs are on the
channel and the coop close is initiated LND handles the closing
flow in the background and the lncli cmd will block until the
transaction is broadcasted to the mempool. In the background LND
disallows any new HTLCs and waits until all HTLCs are resolved
before kicking of the negotiation process.
Moreover if active HTLCs are present and the no_wait param is not
set the error msg is now highlightning it so the user can react
accordingly.
This commit is contained in:
ziggie committed 2025-02-20 17:43:18 +01:00
1 parent 319a0ee470
commit 59443faa36
6 files changed
+2353 -2273

No files matched your search

+9 -2
View File
@@ -878,7 +878,7 @@
},
{
"name": "no_wait",
"description": "If true, then the rpc call will not block while it awaits a closing txid.\nConsequently this RPC call will not return a closing txid if this value\nis set.",
"description": "If true, then the rpc call will not block while it awaits a closing txid\nto be broadcasted to the mempool. To obtain the closing tx one has to\nlisten to the stream for the particular updates. Moreover if a coop close\nis specified and this flag is set to true the coop closing flow will be\ninitiated even if HTLCs are active on the channel. The channel will wait\nuntil all HTLCs are resolved and then start the coop closing process. The\nchannel will be disabled in the meantime and will disallow any new HTLCs.",
"in": "query",
"required": false,
"type": "boolean"
@@ -5475,7 +5475,14 @@
"default": "INITIATOR_UNKNOWN"
},
"lnrpcInstantUpdate": {
"type": "object"
"type": "object",
"properties": {
"num_pending_htlcs": {
"type": "integer",
"format": "int32",
"description": "The number of pending HTLCs that are currently active on the channel.\nThese HTLCs need to be resolved before the channel can be closed\ncooperatively."
}
}
},
"lnrpcInterceptFeedback": {
"type": "object",