server: fix build

This commit is contained in:
Cadey Ratio 2017-04-05 22:14:44 -07:00
parent bb701a0b0b
commit 122e1a87ce
1 changed files with 2 additions and 14 deletions

View File

@ -81,8 +81,7 @@ func New(cfg Config) (*Server, error) {
s := &Server{
cfg: &cfg,
db: db,
tor: t,
db: db,
rpcS: rpcs,
rpcAddr: l.Addr().String(),
@ -196,11 +195,6 @@ func (s *Server) restore() error {
return err
}
_, err = s.tor.AddOnion(pKey, 80, "127.0.0.1:"+s.cfg.WebPort)
if err != nil {
return err
}
log.Printf("added: %s (%s)", rt.Hostname, rt.OnionHostname)
}
@ -234,12 +228,6 @@ func (rs *RPCServer) AddHost(req routerpc.AddHostRequest, resp *routerpc.AddHost
return errors.New("there must be a 1024 bit RSA private key")
}
oi, err := rs.tor.AddOnion(pKey, 80, "127.0.0.1:"+rs.cfg.WebPort)
if err != nil {
return err
}
resp.OnionHostname = oi.OnionID + ".onion"
resp.Token = token
resp.PrivKey = pKey
@ -249,7 +237,7 @@ func (rs *RPCServer) AddHost(req routerpc.AddHostRequest, resp *routerpc.AddHost
resp.Hostname = elfs.MakeName() + rs.cfg.DomainSuffix
}
err = rs.db.SaveRoute(resp)
err := rs.db.SaveRoute(resp)
if err != nil {
return err
}