Skip to content
Snippets Groups Projects
Commit 724d7dc1 authored by inso's avatar inso
Browse files

Fix filtering of nodes to request

parent 21bb11e5
Branches
Tags
No related merge requests found
......@@ -122,4 +122,16 @@ class NodesRepo:
data = c.fetchone()
if data:
return block_uid(data[0])
else:
c = self._conn.execute("""SELECT `current_buid`,
COUNT(`current_buid`) AS `value_occurrence`
FROM `nodes`
WHERE state == 1 AND currency == ?
GROUP BY `current_buid`
ORDER BY `value_occurrence` DESC
LIMIT 1;""", (currency,))
data = c.fetchone()
if data:
return block_uid(data[0])
return BlockUID.empty()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment