Make TCP read timeouts configurable.

This should be helpful on high-latency networks, like Tor or I2P.
Also gofmt.
This commit is contained in:
cathugger 2018-07-29 14:30:13 +00:00
parent dc0c3f9f8b
commit d171552577
No known key found for this signature in database
GPG key ID: 9BADDA2DAF6F01A8
4 changed files with 25 additions and 15 deletions

View file

@ -97,7 +97,7 @@ func (c *Core) Start(nc *config.NodeConfig, log *log.Logger) error {
c.init(&boxPub, &boxPriv, &sigPub, &sigPriv)
c.admin.init(c, nc.AdminListen)
if err := c.tcp.init(c, nc.Listen); err != nil {
if err := c.tcp.init(c, nc.Listen, nc.ReadTimeout); err != nil {
c.log.Println("Failed to start TCP interface")
return err
}