Store host name only instead of full domain name in the internal state

pull/7/head
Martin Boehm 2018-05-31 12:22:53 +02:00
parent a4f28bbc2b
commit 594e5333d6
1 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"log"
"os"
"os/signal"
"strings"
"sync/atomic"
"syscall"
"time"
@ -317,6 +318,9 @@ func newInternalState(coin string, d *db.RocksDB) (*common.InternalState, error)
if err != nil {
glog.Error("get hostname ", err)
} else {
if i := strings.IndexByte(name, '.'); i > 0 {
name = name[:i]
}
is.Host = name
}
return is, nil