Merge pull request #3227 from 2xic/issue_3074

lnd: reject custom fee when force closing channel
This commit is contained in:
Olaoluwa Osuntokun 2019-06-28 13:37:21 -07:00 committed by GitHub
commit c68f747b4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1676,6 +1676,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())