mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
cmd/lncli: add validation of address for connectpeer
This commit is contained in:
parent
a14246c5bb
commit
14aadc8c2e
@ -152,6 +152,10 @@ func connectPeer(ctx *cli.Context) error {
|
||||
|
||||
targetAddress := ctx.Args().Get(0)
|
||||
splitAddr := strings.Split(targetAddress, "@")
|
||||
if len(splitAddr) != 2 {
|
||||
return fmt.Errorf("target address expected in format: lnid@host:port")
|
||||
}
|
||||
|
||||
addr := &lnrpc.LightningAddress{
|
||||
PubKeyHash: splitAddr[0],
|
||||
Host: splitAddr[1],
|
||||
|
Loading…
Reference in New Issue
Block a user