Allow locks to be gathered even when the bot is stopped

This commit is contained in:
Matthias 2020-11-13 06:51:45 +01:00
parent 5f483acdd0
commit 4eb96cfc4f
2 changed files with 0 additions and 9 deletions

View File

@ -605,8 +605,6 @@ class RPC:
def _rpc_locks(self) -> Dict[str, Any]: def _rpc_locks(self) -> Dict[str, Any]:
""" Returns the current locks""" """ Returns the current locks"""
if self._freqtrade.state != State.RUNNING:
raise RPCException('trader is not running')
locks = PairLocks.get_pair_locks(None) locks = PairLocks.get_pair_locks(None)
return { return {

View File

@ -1041,13 +1041,6 @@ def test_telegram_lock_handle(default_conf, update, ticker, fee, mocker) -> None
patch_get_signal(freqtradebot, (True, False)) patch_get_signal(freqtradebot, (True, False))
telegram = Telegram(freqtradebot) telegram = Telegram(freqtradebot)
freqtradebot.state = State.STOPPED
telegram._locks(update=update, context=MagicMock())
assert msg_mock.call_count == 1
assert 'not running' in msg_mock.call_args_list[0][0][0]
msg_mock.reset_mock()
freqtradebot.state = State.RUNNING
PairLocks.lock_pair('ETH/BTC', arrow.utcnow().shift(minutes=4).datetime, 'randreason') PairLocks.lock_pair('ETH/BTC', arrow.utcnow().shift(minutes=4).datetime, 'randreason')
PairLocks.lock_pair('XRP/BTC', arrow.utcnow().shift(minutes=20).datetime, 'deadbeef') PairLocks.lock_pair('XRP/BTC', arrow.utcnow().shift(minutes=20).datetime, 'deadbeef')