From 9eb701f220ea5f75ec87aedfbdb6d5933e70fec3 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sat, 26 Nov 2016 18:19:53 +0900 Subject: [PATCH] Replace $VERSION in the banner file with the ElectrumX version string --- docs/ENV-NOTES | 4 +++- server/protocol.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/ENV-NOTES b/docs/ENV-NOTES index 85616d0..ee70098 100644 --- a/docs/ENV-NOTES +++ b/docs/ENV-NOTES @@ -33,7 +33,9 @@ SSL_PORT - if set will serve Electrum SSL clients on that HOST:SSL_PORT RPC_PORT - Listen on this port for local RPC connections, defaults to 8000. BANNER_FILE - a path to a banner file to serve to clients. The banner file - is re-read for each new client. + is re-read for each new client. The string $VERSION in your + banner file will be replaced with the ElectrumX version you + are runnning, such as 'ElectrumX 0.7.11'. ANON_LOGS - set to anything non-empty to remove IP addresses from logs. By default IP addresses will be logged. DONATION_ADDRESS - server donation address. Defaults to none. diff --git a/server/protocol.py b/server/protocol.py index 8690ea9..7e95a19 100644 --- a/server/protocol.py +++ b/server/protocol.py @@ -837,6 +837,8 @@ class ElectrumX(Session): except Exception as e: self.logger.error('reading banner file {}: {}' .format(self.env.banner_file, e)) + else: + banner = banner.replace('$VERSION', VERSION) return banner async def donation_address(self, params):