Add order by to lookup db query (#1172)

This commit is contained in:
Jonathan Zernik 2021-09-03 15:30:49 -07:00 committed by GitHub
parent 13e7dd0226
commit 8f55a3729f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -459,6 +459,11 @@ class SqueakDb:
s = s.where(self.squeaks.c.hash_reply_sqk == reply_to_hash)
if not include_locked:
s = s.where(self.squeak_has_secret_key)
s = s.order_by(
self.squeaks.c.n_block_height.desc(),
self.squeaks.c.n_time.desc(),
self.squeaks.c.hash.desc(),
)
logger.debug("Query s: {}".format(s))