Check explicit for bool in filter interrupt check
This commit is contained in:
parent
290fa1844d
commit
927913bd02
@ -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):
|
||||
|
@ -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'))
|
||||
|
Loading…
Reference in New Issue
Block a user