From 530eadd11c362575e5ad7d01e3116295844af330 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 11 Dec 2018 15:56:00 -0800 Subject: [PATCH] rpcserver: ensure ChannelPoint is set in CloseChannel Fixes #2317. --- rpcserver.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpcserver.go b/rpcserver.go index 3456789a..69ea0867 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -1280,6 +1280,12 @@ func getChanPointFundingTxid(chanPoint *lnrpc.ChannelPoint) ([]byte, error) { func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest, updateStream lnrpc.Lightning_CloseChannelServer) error { + // If the user didn't specify a channel point, then we'll reject this + // request all together. + if in.GetChannelPoint() == nil { + return fmt.Errorf("must specify channel point in close channel") + } + force := in.Force index := in.ChannelPoint.OutputIndex txidHash, err := getChanPointFundingTxid(in.GetChannelPoint())