rpcserver: ensure ChannelPoint is set in CloseChannel

Fixes #2317.
This commit is contained in:
Olaoluwa Osuntokun 2018-12-11 15:56:00 -08:00
parent 71444e74ac
commit 530eadd11c
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

@ -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())