diff --git a/gsrest/db/cassandra.py b/gsrest/db/cassandra.py index 8bf45f70..ae8a2c08 100644 --- a/gsrest/db/cassandra.py +++ b/gsrest/db/cassandra.py @@ -175,7 +175,8 @@ def merge_address_txs_subquery_results( if border_tx_id is None: border_tx_id = results[-1][tx_id_keys] continue - border_tx_id = min(border_tx_id, results[-1][tx_id_keys]) + order = min if ascending else max + border_tx_id = order(border_tx_id, results[-1][tx_id_keys]) # cut result_sets so that we only have the overlapping rows below/above # the border_tx_id