From ad13d2d407d2f614c39af92430fda0a926da2a8a Mon Sep 17 00:00:00 2001 From: gluk256 Date: Thu, 24 Jan 2019 15:35:10 +0400 Subject: swarm/version: commit version added (#18510) --- swarm/network/kademlia.go | 4 ++++ swarm/version/version.go | 3 +++ 2 files changed, 7 insertions(+) (limited to 'swarm') diff --git a/swarm/network/kademlia.go b/swarm/network/kademlia.go index 2c2276251..9f4245603 100644 --- a/swarm/network/kademlia.go +++ b/swarm/network/kademlia.go @@ -27,6 +27,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/swarm/log" "github.com/ethereum/go-ethereum/swarm/pot" + sv "github.com/ethereum/go-ethereum/swarm/version" ) /* @@ -552,6 +553,9 @@ func (k *Kademlia) string() string { var rows []string rows = append(rows, "=========================================================================") + if len(sv.GitCommit) > 0 { + rows = append(rows, fmt.Sprintf("commit hash: %s", sv.GitCommit)) + } rows = append(rows, fmt.Sprintf("%v KΛÐΞMLIΛ hive: queen's address: %x", time.Now().UTC().Format(time.UnixDate), k.BaseAddr()[:3])) rows = append(rows, fmt.Sprintf("population: %d (%d), NeighbourhoodSize: %d, MinBinSize: %d, MaxBinSize: %d", k.conns.Size(), k.addrs.Size(), k.NeighbourhoodSize, k.MinBinSize, k.MaxBinSize)) diff --git a/swarm/version/version.go b/swarm/version/version.go index fb4c53111..9c7248110 100644 --- a/swarm/version/version.go +++ b/swarm/version/version.go @@ -41,6 +41,9 @@ var VersionWithMeta = func() string { return v }() +// Git SHA1 commit hash of the release, will be set by main.init() function +var GitCommit string + // ArchiveVersion holds the textual version string used for Swarm archives. // e.g. "0.3.0-dea1ce05" for stable releases, or // "0.3.1-unstable-21c059b6" for unstable releases -- cgit v1.2.3