Skip to content

Commit

Permalink
fix sql (#75)
Browse files Browse the repository at this point in the history
Added a check to remove tx with only one node backing it. This deals with bad nodes with large numbers of dead unconfirmed transactions
  • Loading branch information
i25959341 authored and f27d committed Aug 10, 2018
1 parent b0d3740 commit a16ecf1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions neo-redis/unconfirmedTx/updateRedisUnconfirmedTx.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@

cursor = conn.cursor()

cursor.execute("""SELECT count(connection_id) as node_count, tx, max(last_blockheight)
FROM public.unconfirmed_tx
where last_blockheight = (select max(blockheight) from blockheight_history)
having count(connection_id) > 1
group by tx
order by node_count desc""")
cursor.execute("""select
count( connection_id ) as node_count,
tx,
max( last_blockheight )
from
public.unconfirmed_tx
where last_blockheight = (select max(blockheight) from blockheight_history)
group by
tx
HAVING count( connection_id )>1
order by
node_count desc""")

result = cursor.fetchall()
print(result)
Expand Down

0 comments on commit a16ecf1

Please sign in to comment.