peer: reject remote closes with active HTLCs
In this commit, we follow up to the prior commit by ensuring we won't accept a co-op close request for a chennel with active HTLCs. When creating a chanCloser for the first time, we'll check the set of HTLC's and reject a request (by sending a wire error) if the target channel still as active HTLC's.
This commit is contained in:
2 files changed
+24
-7
No files matched your search
+2
-2
@@ -1094,8 +1094,8 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
|
||||
// Before we attempt the cooperative channel closure, we'll
|
||||
// examine the channel to ensure that it doesn't have a
|
||||
// lingering HTLC.
|
||||
if len(channel.localCommit.Htlcs) != 0 {
|
||||
return nil, fmt.Errorf("cannot co-op close channel " +
|
||||
if len(channel.ActiveHtlcs()) != 0 {
|
||||
return fmt.Errorf("cannot co-op close channel " +
|
||||
"with active htlcs")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user