Skip to content

Commit

Permalink
re-use existing constraints cleanup function
Browse files Browse the repository at this point in the history
  • Loading branch information
eukreign committed Apr 6, 2022
1 parent 80b9184 commit 8364458
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lbry/wallet/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,9 +1211,7 @@ async def get_addresses(self, cols=None, read_only=False, **constraints):
return addresses

async def get_address_count(self, cols=None, read_only=False, **constraints):
# this is a count query that returns one line. Don't pass offset.
if 'offset' in constraints:
constraints.pop('offset')
self._clean_txo_constraints_for_aggregation(constraints)
count = await self.select_addresses('COUNT(*) as total', read_only=read_only, **constraints)
return count[0]['total'] or 0

Expand Down

0 comments on commit 8364458

Please sign in to comment.