From 32d4e3a3b633941d8b7a3ca86b3edda16642fa11 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 16 Jan 2016 19:12:03 -0800 Subject: [PATCH] lnshell: comment out lnchat, it's in limbo before we add the message to unwire --- cmd/lnshell/commands.go | 26 +++++--------------------- cmd/lnshell/lnshellmain.go | 11 ++--------- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/cmd/lnshell/commands.go b/cmd/lnshell/commands.go index d746100a..a883c9be 100644 --- a/cmd/lnshell/commands.go +++ b/cmd/lnshell/commands.go @@ -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 -} +}*/ diff --git a/cmd/lnshell/lnshellmain.go b/cmd/lnshell/lnshellmain.go index ce41810a..0ed2d388 100644 --- a/cmd/lnshell/lnshellmain.go +++ b/cmd/lnshell/lnshellmain.go @@ -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 }