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