chainsyncer

Blockchain syncer driver
Log | Files | Refs | LICENSE

commit 927913bd02c303f2232a4a08df15888db567a310
parent 290fa1844d4e5e53a2c0f885c6ca628037f94abe
Author: lash <dev@holbrook.no>
Date:   Mon, 25 Apr 2022 06:28:42 +0000

Check explicit for bool in filter interrupt check

Diffstat:
Mchainsyncer/session.py | 4++++
Mchainsyncer/store/base.py | 2+-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/chainsyncer/session.py b/chainsyncer/session.py @@ -1,9 +1,12 @@ # standard imports import uuid +import logging # local imports from chainsyncer.error import FilterDone +logg = logging.getLogger(__name__) + class SyncSession: @@ -29,6 +32,7 @@ class SyncSession: def filter(self, conn, block, tx): self.session_store.connect() for fltr in self.filters: + logg.debug('executing filter {}'.format(fltr)) self.item.advance() interrupt = fltr.filter(conn, block, tx) if not self.item.release(interrupt=interrupt): diff --git a/chainsyncer/store/base.py b/chainsyncer/store/base.py @@ -121,7 +121,7 @@ class SyncItem: def release(self, interrupt=False): if self.skip_filter: return False - if interrupt: + if interrupt == True: self.filter_state.unset(self.state_key, self.filter_state.from_name('LOCK')) self.filter_state.set(self.state_key, self.filter_state.from_name('INTERRUPT')) self.filter_state.set(self.state_key, self.filter_state.from_name('DONE'))