Skip to content

Commit 18ce8af

Browse files
committed
fix: validate config when calling pair_history
closes freqtrade#11271
1 parent 7f7cff8 commit 18ce8af

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

freqtrade/rpc/api_server/api_pair_history.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from fastapi import APIRouter, Depends, HTTPException
55

6+
from freqtrade.configuration import validate_config_consistency
67
from freqtrade.rpc.api_server.api_pairlists import handleExchangePayload
78
from freqtrade.rpc.api_server.api_schemas import PairHistory, PairHistoryRequest
89
from freqtrade.rpc.api_server.deps import get_config, get_exchange
@@ -26,17 +27,18 @@ def pair_history(
2627
):
2728
# The initial call to this endpoint can be slow, as it may need to initialize
2829
# the exchange class.
29-
config = deepcopy(config)
30-
config.update(
30+
config_loc = deepcopy(config)
31+
config_loc.update(
3132
{
3233
"timeframe": timeframe,
3334
"strategy": strategy,
3435
"timerange": timerange,
35-
"freqaimodel": freqaimodel if freqaimodel else config.get("freqaimodel"),
36+
"freqaimodel": freqaimodel if freqaimodel else config_loc.get("freqaimodel"),
3637
}
3738
)
39+
validate_config_consistency(config_loc)
3840
try:
39-
return RPC._rpc_analysed_history_full(config, pair, timeframe, exchange, None, False)
41+
return RPC._rpc_analysed_history_full(config_loc, pair, timeframe, exchange, None, False)
4042
except Exception as e:
4143
raise HTTPException(status_code=502, detail=str(e))
4244

@@ -58,6 +60,9 @@ def pair_history_filtered(payload: PairHistoryRequest, config=Depends(get_config
5860
)
5961
handleExchangePayload(payload, config_loc)
6062
exchange = get_exchange(config_loc)
63+
64+
validate_config_consistency(config_loc)
65+
6166
try:
6267
return RPC._rpc_analysed_history_full(
6368
config_loc,

0 commit comments

Comments
 (0)