multi: ensure NodeKey is set in rpc/cli
This commit is contained in:
parent
915c4201b9
commit
4c42079436
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user