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:
6 files changed
+2353
-2273
No files matched your search
+2273
-2254
File diff suppressed because it is too large.
Load diff
+11
-3
@@ -2146,9 +2146,13 @@ message CloseChannelRequest {
|
||||
// NOTE: This field is only respected if we're the initiator of the channel.
|
||||
uint64 max_fee_per_vbyte = 7;
|
||||
|
||||
// If true, then the rpc call will not block while it awaits a closing txid.
|
||||
// Consequently this RPC call will not return a closing txid if this value
|
||||
// is set.
|
||||
// If true, then the rpc call will not block while it awaits a closing txid
|
||||
// to be broadcasted to the mempool. To obtain the closing tx one has to
|
||||
// listen to the stream for the particular updates. Moreover if a coop close
|
||||
// is specified and this flag is set to true the coop closing flow will be
|
||||
// initiated even if HTLCs are active on the channel. The channel will wait
|
||||
// until all HTLCs are resolved and then start the coop closing process. The
|
||||
// channel will be disabled in the meantime and will disallow any new HTLCs.
|
||||
bool no_wait = 8;
|
||||
}
|
||||
|
||||
@@ -2166,6 +2170,10 @@ message PendingUpdate {
|
||||
}
|
||||
|
||||
message InstantUpdate {
|
||||
// The number of pending HTLCs that are currently active on the channel.
|
||||
// These HTLCs need to be resolved before the channel can be closed
|
||||
// cooperatively.
|
||||
int32 num_pending_htlcs = 1;
|
||||
}
|
||||
|
||||
message ReadyForPsbtFunding {
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user