Replace $DAEMON_VERSION and $DAEMON_SUBVERSION
in banner file.
This commit is contained in:
parent
9c8f0283c9
commit
0892b12036
@ -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
|
||||
--------------
|
||||
|
||||
|
||||
@ -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.'''
|
||||
|
||||
@ -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):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user