From fcaf8c029b2093b9b53b1692b14ace1a32c68bfc Mon Sep 17 00:00:00 2001 From: 2xic <5640782+2xic@users.noreply.github.com> Date: Thu, 20 Jun 2019 12:02:36 +0200 Subject: [PATCH] lnd: reject custom fee when force closing channel --- rpcserver.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpcserver.go b/rpcserver.go index 604dbc55..7b248386 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -1674,6 +1674,12 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest, return fmt.Errorf("must specify channel point in close channel") } + // If force closing a channel, the fee set in the commitment transaction + // is used. + if in.Force && (in.SatPerByte != 0 || in.TargetConf != 0) { + return fmt.Errorf("force closing a channel uses a pre-defined fee") + } + force := in.Force index := in.ChannelPoint.OutputIndex txid, err := GetChanPointFundingTxid(in.GetChannelPoint())