From 36f3d6684a4ac2f11f8787c5dc766b1f12e46e81 Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Tue, 18 Feb 2014 15:44:02 -0300 Subject: [PATCH] #340 added mining pool detection on homepage and block list page --- app/controllers/blocks.js | 8 +++++++- public/views/block.html | 4 +++- public/views/block_list.html | 2 ++ public/views/index.html | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/controllers/blocks.js b/app/controllers/blocks.js index 409679f..def4e35 100644 --- a/app/controllers/blocks.js +++ b/app/controllers/blocks.js @@ -66,7 +66,12 @@ var getBlock = function(blockhash, cb) { isOrphan: 1, }; } - return cb(err, block.info); + + bdb.getPoolInfo(block.info.tx[0], function(info) { + block.info.poolInfo = info; + return cb(err, block.info); + }); + }); }; @@ -130,6 +135,7 @@ exports.list = function(req, res) { hash: b.hash, time: b.ts || info.time, txlength: info.tx.length, + poolInfo: info.poolInfo }); }); }, function(err, allblocks) { diff --git a/public/views/block.html b/public/views/block.html index e68ea07..41f012e 100644 --- a/public/views/block.html +++ b/public/views/block.html @@ -55,7 +55,9 @@ Relayed by - {{block.poolInfo.poolName}} + + {{block.poolInfo.poolName}} + Merkle Root diff --git a/public/views/block_list.html b/public/views/block_list.html index 99d9ffd..ea6d841 100644 --- a/public/views/block_list.html +++ b/public/views/block_list.html @@ -35,6 +35,7 @@ Height Timestamp Transactions + Relayed by Size @@ -46,6 +47,7 @@ {{b.height}} {{b.time * 1000 | date:'medium'}} {{b.txlength}} + {{b.poolInfo.poolName}} {{b.size}} diff --git a/public/views/index.html b/public/views/index.html index 585e5fd..96dbeae 100644 --- a/public/views/index.html +++ b/public/views/index.html @@ -13,6 +13,7 @@ Height Age Transactions + Relayed by Size @@ -24,6 +25,7 @@ {{humanSince(b.time)}} {{b.txlength}} + {{b.poolInfo.poolName}} {{b.size}} bytes