From 4c4cd92c54ba99155e58e3b7cd7b6fef9ed52470 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Wed, 21 Dec 2016 20:22:10 +0900 Subject: [PATCH] Banner: add $DONATION_ADDRESS meta variable Replaced with the DONATION_ADDRESS environment variable --- server/protocol.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/protocol.py b/server/protocol.py index 950f703..b008fe1 100644 --- a/server/protocol.py +++ b/server/protocol.py @@ -987,10 +987,13 @@ class ElectrumX(Session): 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)) + for pair in [ + ('$VERSION', VERSION), + ('$DAEMON_VERSION', version), + ('$DAEMON_SUBVERSION', network_info['subversion']), + ('$DONATION_ADDRESS', self.env.donation_address), + ]: + banner = banner.replace(*pair) return banner