From a0e00399888ef42320dcabbe0483fb38896a7054 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 15 Sep 2021 13:32:11 -0400 Subject: [PATCH] handle invalid release time --- lbry/wallet/server/session.py | 8 ++++++-- tests/integration/blockchain/test_claim_commands.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lbry/wallet/server/session.py b/lbry/wallet/server/session.py index 23b713d1a..003174267 100644 --- a/lbry/wallet/server/session.py +++ b/lbry/wallet/server/session.py @@ -979,8 +979,12 @@ class LBRYElectrumX(SessionBase): async def claimtrie_search(self, **kwargs): start = time.perf_counter() - if isinstance(kwargs, dict): - kwargs['release_time'] = format_release_time(kwargs.get('release_time')) + if 'release_time' in kwargs: + release_time = kwargs.pop('release_time') + try: + kwargs['release_time'] = format_release_time(release_time) + except ValueError: + pass try: self.session_mgr.pending_query_metric.inc() if 'channel' in kwargs: diff --git a/tests/integration/blockchain/test_claim_commands.py b/tests/integration/blockchain/test_claim_commands.py index 448c6c721..07f787437 100644 --- a/tests/integration/blockchain/test_claim_commands.py +++ b/tests/integration/blockchain/test_claim_commands.py @@ -1767,6 +1767,7 @@ class StreamCommands(ClaimTestCase): self.assertEqual(3, len(await self.claim_search(release_time='>0', order_by=['release_time']))) self.assertEqual(3, len(await self.claim_search(release_time='>=0', order_by=['release_time']))) self.assertEqual(4, len(await self.claim_search(order_by=['release_time']))) + self.assertEqual(4, len(await self.claim_search(release_time='