mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
election logging
This commit is contained in:
parent
eb10ffcba0
commit
877fc15456
@ -4,6 +4,8 @@ Specifically, what happens when a block becomes invalid. The logic is
|
|||||||
encapsulated in the ``Election`` class, while the sequence of actions
|
encapsulated in the ``Election`` class, while the sequence of actions
|
||||||
is specified in ``create_pipeline``.
|
is specified in ``create_pipeline``.
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
|
|
||||||
import rethinkdb as r
|
import rethinkdb as r
|
||||||
from multipipes import Pipeline, Node
|
from multipipes import Pipeline, Node
|
||||||
|
|
||||||
@ -11,6 +13,9 @@ from bigchaindb.pipelines.utils import ChangeFeed
|
|||||||
from bigchaindb import Bigchain
|
from bigchaindb import Bigchain
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Election:
|
class Election:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -30,6 +35,9 @@ class Election:
|
|||||||
"""
|
"""
|
||||||
Liquidates transactions from invalid blocks so they can be processed again
|
Liquidates transactions from invalid blocks so they can be processed again
|
||||||
"""
|
"""
|
||||||
|
logger.info('Rewriting %s transactions from invalid block %s',
|
||||||
|
len(invalid_block['block']['transactions']),
|
||||||
|
invalid_block['id'])
|
||||||
for tx in invalid_block['block']['transactions']:
|
for tx in invalid_block['block']['transactions']:
|
||||||
self.bigchain.write_transaction(tx)
|
self.bigchain.write_transaction(tx)
|
||||||
return invalid_block
|
return invalid_block
|
||||||
|
Loading…
x
Reference in New Issue
Block a user