Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // The full version string Version = "1.0.6" // GitCommit is set with --ldflags "-X main.gitCommit=$(git rev-parse HEAD)" GitCommit string Status *UpdateStatus )
Functions ¶
func CompatibleWith ¶
CompatibleWith checks whether the remote peer version is compatible with the node itself. RULES: | local | remote | | - | - | | 1.0.3 | same major&moinor version. | | 1.0.4 | same major version. |
Types ¶
type UpdateStatus ¶
func (*UpdateStatus) AddSeed ¶
func (s *UpdateStatus) AddSeed(seedAddr string)
func (*UpdateStatus) CheckUpdate ¶
func (s *UpdateStatus) CheckUpdate(localVerStr string, remoteVerStr string, remoteAddr string) error
CheckUpdate checks whether there is a newer version to update. If there is, it set the "Status" variable to a proper value.
params: localVerStr: the version of the node itself remoteVerStr: the version received from a seed node. remoteAddr: the version received from a seed node.
current rule:
- small update: seed version is higher than the node itself
- significant update: seed mojor version is higher than the node itself
func (*UpdateStatus) MaxVerSeen ¶
func (s *UpdateStatus) MaxVerSeen() string
func (*UpdateStatus) VersionStatus ¶
func (s *UpdateStatus) VersionStatus() uint16
Click to show internal directories.
Click to hide internal directories.