chainqueue

Blockchain transaction queue control
Log | Files | Refs | LICENSE

commit b8c2b1b86a401e6ae3da0e6a8bbf4e463d91f844
parent c94b291d394432746279b40e2822be2c3d9d39e2
Author: lash <dev@holbrook.no>
Date:   Sat, 30 Apr 2022 16:43:55 +0000

Sort statewise results

Diffstat:
Mchainqueue/store/base.py | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/chainqueue/store/base.py b/chainqueue/store/base.py @@ -77,21 +77,27 @@ class Store: return (s, v,) - def by_state(self, state=0, limit=4096, strict=False, threshold=None): + def by_state(self, state=0, not_state=0, limit=4096, strict=False, threshold=None): hashes = [] i = 0 refs_state = self.state_store.list(state) + refs_state.sort() for ref in refs_state: v = from_key(ref) hsh = v[2] + item_state = self.state_store.state(ref) + if strict: - item_state = self.state_store.state(ref) if item_state & state != item_state: continue + logg.info('state {} {}'.format(ref, item_state)) + if item_state & not_state > 0: + continue + if threshold != None: v = self.state_store.modified(ref) if v > threshold: