fix compile error after sync

This commit is contained in:
verokarhu 2014-09-28 11:02:57 +03:00
parent 600829b4e7
commit 7b22bdc68b

View File

@ -6,6 +6,8 @@ import (
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
"github.com/jbenet/go-ipfs/daemon"
h "github.com/jbenet/go-ipfs/server/http"
)
@ -48,11 +50,21 @@ func serveHttpCmd(c *commander.Command, _ []string) error {
return err
}
fmt.Println("starting new daemon listener...")
dl, err := daemon.NewDaemonListener(n, "localhost:12345")
// launch the API RPC endpoint.
if n.Config.Addresses.API == "" {
return errors.New("no config.RPCAddress endpoint supplied")
}
maddr, err := ma.NewMultiaddr(n.Config.Addresses.API)
if err != nil {
return err
}
dl, err := daemon.NewDaemonListener(n, maddr)
if err != nil {
fmt.Println("Failed to create daemon listener.")
return err
}
go dl.Listen()
defer dl.Close()