Skip to content

Commit

Permalink
Don't check for lock start date
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Oct 20, 2020
1 parent cd2866e commit 0daf77f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions freqtrade/persistence/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,7 @@ def get_pair_locks(pair: Optional[str], now: Optional[datetime] = None) -> List[
if not now:
now = datetime.now(timezone.utc)

filters = [func.datetime(PairLock.lock_time) <= now,
func.datetime(PairLock.lock_end_time) >= now,
filters = [func.datetime(PairLock.lock_end_time) >= now,
# Only active locks
PairLock.active.is_(True), ]
if pair:
Expand Down Expand Up @@ -742,7 +741,6 @@ def is_pair_locked(pair: str, now: Optional[datetime] = None) -> bool:

return PairLock.query.filter(
PairLock.pair == pair,
func.datetime(PairLock.lock_time) <= now,
func.datetime(PairLock.lock_end_time) >= now,
# Only active locks
PairLock.active.is_(True),
Expand Down

0 comments on commit 0daf77f

Please sign in to comment.