mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
poison pill
This commit is contained in:
parent
8ab1cfdfa1
commit
5572176f7c
@ -213,6 +213,11 @@ class Election(object):
|
||||
while True:
|
||||
next_block = self.q_block_new_vote.get()
|
||||
|
||||
# poison pill
|
||||
if next_block == 'stop':
|
||||
logger.info('clean exit')
|
||||
return
|
||||
|
||||
if b.block_voted_invalid(next_block):
|
||||
self.q_invalid_blocks.put(next_block)
|
||||
|
||||
@ -227,6 +232,12 @@ class Election(object):
|
||||
for tx in invalid_block['transactions']:
|
||||
b.write_transaction(tx)
|
||||
|
||||
def kill(self):
|
||||
"""
|
||||
Terminate processes
|
||||
"""
|
||||
self.q_block_new_vote.put('stop')
|
||||
|
||||
def start(self):
|
||||
"""
|
||||
Initialize, spawn, and start the processes
|
||||
|
Loading…
x
Reference in New Issue
Block a user