Display block propagation time

This commit is contained in:
maciejhirsz
2018-07-08 16:04:55 +02:00
parent 3259bc67a3
commit 47b80ad30e
10 changed files with 127 additions and 68 deletions
+3
View File
@@ -77,10 +77,13 @@ export default class Chain {
if (node.height > this.height) {
this.height = node.height;
this.blockTimestamp = node.blockTimestamp;
node.propagationTime = 0 as Types.PropagationTime;
this.feeds.broadcast(Feed.bestBlock(this.height, this.blockTimestamp));
console.log(`[${this.label}] New block ${this.height}`);
} else if (node.height === this.height) {
node.propagationTime = (node.blockTimestamp - this.blockTimestamp) as Types.PropagationTime;
}
this.feeds.broadcast(Feed.imported(node));