multi: ensure NodeKey is set in rpc/cli

This commit is contained in:
MeshCollider 2018-02-20 11:55:22 +13:00 committed by Olaoluwa Osuntokun
parent 915c4201b9
commit 4c42079436
2 changed files with 6 additions and 1 deletions

@ -720,6 +720,11 @@ func (r *rpcServer) OpenChannel(in *lnrpc.OpenChannelRequest,
// TODO(roasbeef): also return channel ID?
// Ensure that the NodePubKey is set before attempting to use it
if len(in.NodePubkey) == 0 {
return fmt.Errorf("NodePubKey is not set")
}
// Parse the raw bytes of the node key into a pubkey object so we
// can easily manipulate it.
nodePubKey, err = btcec.ParsePubKey(in.NodePubkey, btcec.S256())

@ -1773,7 +1773,7 @@ func (s *server) DisconnectPeer(pubKey *btcec.PublicKey) error {
}
// OpenChannel sends a request to the server to open a channel to the specified
// peer identified by Public Key with the passed channel funding parameters.
// peer identified by nodeKey with the passed channel funding parameters.
//
// NOTE: This function is safe for concurrent access.
func (s *server) OpenChannel(nodeKey *btcec.PublicKey,