lnshell: comment out lnchat, it's in limbo before we add the message to unwire

This commit is contained in:
Olaoluwa Osuntokun 2016-01-16 19:12:03 -08:00
parent 4b696f1690
commit 32d4e3a3b6
2 changed files with 7 additions and 30 deletions

@ -1,7 +1,6 @@
package main
import (
"encoding/hex"
"fmt"
"time"
@ -40,37 +39,22 @@ func RpcConnect(args []string) error {
}
func LnConnect(args []string) error {
// var err error
if len(args) == 0 {
return fmt.Errorf("need: lnc pubkeyhash@hostname or pkh (via pbx)")
}
req := new(lnrpc.LNConnectRequest)
req.IdAtHost = args[0]
resp, err := z.LNConnect(stub, req)
req := &lnrpc.ConnectPeerRequest{args[0]}
resp, err := z.ConnectPeer(stub, req)
if err != nil {
return err
}
fmt.Printf("connected. remote lnid is %x\n", resp.LnID)
return nil
}
// LnListen listens on the default port for incoming connections
func LnListen(args []string) error {
req := new(lnrpc.TCPListenRequest)
req.Hostport = "0.0.0.0:2448"
_, err := z.TCPListen(stub, req)
if err != nil {
return err
}
fmt.Printf("started TCP port listener\n")
return nil
}
// For testing. Syntax: lnhi hello world
func LnChat(args []string) error {
/*func LnChat(args []string) error {
var err error
if len(args) < 2 {
return fmt.Errorf("too short, need: lnhi 32hexcharLNID message.\n")
@ -99,4 +83,4 @@ func LnChat(args []string) error {
}
fmt.Printf("got response but there's nothing in it\n")
return nil
}
}*/

@ -64,13 +64,13 @@ func Shellparse(cmdslice []string) error {
return fmt.Errorf("User exit")
}
if cmd == "lnhi" {
/*if cmd == "lnhi" {
err = LnChat(args)
if err != nil {
fmt.Printf("LN chat error: %s\n", err)
}
return nil
}
}*/
if cmd == "lnc" {
err = LnConnect(args)
if err != nil {
@ -78,13 +78,6 @@ func Shellparse(cmdslice []string) error {
}
return nil
}
if cmd == "lnl" {
err = LnListen(args)
if err != nil {
fmt.Printf("LN listen error: %s\n", err)
}
return nil
}
fmt.Printf("Command not recognized.\n")
return nil
}