Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Add logs for new blocks - Closes #4074 #4076

Merged
merged 1 commit into from
Aug 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions framework/src/modules/chain/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ module.exports = class Chain {
block.transactions,
);
}
this.logger.info(
{ id: block.id, height: block.height },
'Deleted a block from the chain',
);
this.channel.publish('chain:blocks:change', block);
});

Expand All @@ -498,6 +502,14 @@ module.exports = class Chain {
block.transactions,
);
}
this.logger.info(
{
id: block.id,
height: block.height,
numberOfTransactions: block.transactions.length,
},
'New block added to the chain',
);
this.channel.publish('chain:blocks:change', block);
});

Expand All @@ -511,6 +523,10 @@ module.exports = class Chain {

this.blocks.on(EVENT_NEW_BROADHASH, ({ broadhash, height }) => {
this.channel.invoke('app:updateApplicationState', { broadhash, height });
this.logger.debug(
{ broadhash, height },
'Updating the application state',
);
});

this.transactionPool.on(EVENT_MULTISIGNATURE_SIGNATURE, signature => {
Expand Down