rpcserver: Use func for semver string.

This constructs the RPC API semantic version string from the individual
major, minor, and path constants versus requiring updates in both
places.  This is something contributors have previously forgotten to
update, so it makes sense to avoid the need to do it altogether.
This commit is contained in:
Dave Collins 2020-07-22 19:13:26 -05:00
parent 61705d7501
commit 1f308b4cb2
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2

View File

@ -54,10 +54,9 @@ import (
// API version constants
const (
jsonrpcSemverString = "6.1.1"
jsonrpcSemverMajor = 6
jsonrpcSemverMinor = 1
jsonrpcSemverPatch = 2
jsonrpcSemverMajor = 6
jsonrpcSemverMinor = 1
jsonrpcSemverPatch = 2
)
const (
@ -99,6 +98,11 @@ const (
)
var (
// jsonrpcSemverString is the RPC server's semantic API version formatted as
// a string.
jsonrpcSemverString = fmt.Sprintf("%d.%d.%d", jsonrpcSemverMajor,
jsonrpcSemverMinor, jsonrpcSemverPatch)
// blake256Pad is the extra blake256 internal padding needed for the
// data of the getwork RPC. It is set in the init routine since it is
// based on the size of the block header and requires a bit of