diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6d18dda..c88c6f7 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -1,3 +1,16 @@ +version 0.7.15 +-------------- + +The following meta variables in your banner file are now replaced in +addition to $VERSION described in the notes to 0.17.11. If you type +getnetworkinfo in your daemon's debug console you will see what they +are based on: + +- $DAEMON_VERSION is replaced with the daemon's version as a dot-separated + string. For example "0.12.1". +- $DAEMON_SUBVERSION is replaced with the daemon's user agent string. + For example, "/BitcoinUnlimited:0.12.1(EB16; AD4)/". + version 0.7.14 -------------- diff --git a/server/daemon.py b/server/daemon.py index 40d9816..cee7717 100644 --- a/server/daemon.py +++ b/server/daemon.py @@ -156,11 +156,15 @@ class Daemon(util.LoggedClass): '''Return the fee estimate for the given parameters.''' return await self._send_single('estimatefee', params) + async def getnetworkinfo(self): + '''Return the result of the 'getnetworkinfo' RPC call.''' + return await self._send_single('getnetworkinfo') + async def relayfee(self): '''The minimum fee a low-priority tx must pay in order to be accepted to the daemon's memory pool.''' - net_info = await self._send_single('getnetworkinfo') - return net_info['relayfee'] + network_info = await self.getnetworkinfo() + return network_info['relayfee'] async def getrawtransaction(self, hex_hash): '''Return the serialized raw transaction with the given hash.''' diff --git a/server/protocol.py b/server/protocol.py index 61cb456..bae092d 100644 --- a/server/protocol.py +++ b/server/protocol.py @@ -889,7 +889,17 @@ class ElectrumX(Session): self.logger.error('reading banner file {}: {}' .format(self.env.banner_file, e)) else: - banner = banner.replace('$VERSION', VERSION) + network_info = await self.daemon.getnetworkinfo() + version = network_info['version'] + major, minor = divmod(version, 1000000) + minor, revision = divmod(minor, 10000) + revision //= 100 + version = '{:d}.{:d}.{:d}'.format(major, minor, revision) + subversion = network_info['subversion'] + banner = (banner.replace('$VERSION', VERSION) + .replace('$DAEMON_VERSION', version) + .replace('$DAEMON_SUBVERSION', subversion)) + return banner async def donation_address(self, params): diff --git a/server/version.py b/server/version.py index 91af34e..2317499 100644 --- a/server/version.py +++ b/server/version.py @@ -1 +1 @@ -VERSION = "ElectrumX 0.7.14" +VERSION = "ElectrumX 0.7.15"