From c0a57d352f7f8058cb20c4b60b4b5779ca9b1a45 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 25 Mar 2023 08:16:07 +0100 Subject: [PATCH] send base_currency with messages that need it. --- freqtrade/freqtradebot.py | 2 ++ freqtrade/rpc/rpc_manager.py | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 1f7b4493c..1f072571d 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1859,6 +1859,7 @@ class FreqtradeBot(LoggingMixin): if prot_trig: msg: RPCProtectionMsg = { 'type': RPCMessageType.PROTECTION_TRIGGER, + 'base_currency': self.exchange.get_pair_base_currency(prot_trig.pair), **prot_trig.to_json() # type: ignore } self.rpc.send_msg(msg) @@ -1867,6 +1868,7 @@ class FreqtradeBot(LoggingMixin): if prot_trig_glb: msg = { 'type': RPCMessageType.PROTECTION_TRIGGER_GLOBAL, + 'base_currency': self.exchange.get_pair_base_currency(prot_trig_glb.pair), **prot_trig_glb.to_json() # type: ignore } self.rpc.send_msg(msg) diff --git a/freqtrade/rpc/rpc_manager.py b/freqtrade/rpc/rpc_manager.py index e4c925995..1972ad6e5 100644 --- a/freqtrade/rpc/rpc_manager.py +++ b/freqtrade/rpc/rpc_manager.py @@ -70,10 +70,6 @@ class RPCManager: """ if msg.get('type') not in NO_ECHO_MESSAGES: logger.info('Sending rpc message: %s', msg) - if 'pair' in msg: - msg.update({ - 'base_currency': self._rpc._freqtrade.exchange.get_pair_base_currency(msg['pair']) - }) for mod in self.registered_modules: logger.debug('Forwarding message to rpc.%s', mod.name) try: