From 877fc15456440722dae745cff641a1f6375aefa4 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 3 Aug 2016 17:38:40 +0200 Subject: [PATCH] election logging --- bigchaindb/pipelines/election.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bigchaindb/pipelines/election.py b/bigchaindb/pipelines/election.py index 0f002f9a..538a5453 100644 --- a/bigchaindb/pipelines/election.py +++ b/bigchaindb/pipelines/election.py @@ -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 is specified in ``create_pipeline``. """ +import logging + import rethinkdb as r from multipipes import Pipeline, Node @@ -11,6 +13,9 @@ from bigchaindb.pipelines.utils import ChangeFeed from bigchaindb import Bigchain +logger = logging.getLogger(__name__) + + class Election: def __init__(self): @@ -30,6 +35,9 @@ class Election: """ 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']: self.bigchain.write_transaction(tx) return invalid_block