shows orphan status on block page

This commit is contained in:
Matias Alejo Garcia 2014-02-10 11:00:31 -03:00
parent 31ec198f38
commit 0bbc9763b2
2 changed files with 15 additions and 4 deletions

View File

@ -139,6 +139,8 @@ function spec(b) {
BlockDb.prototype.fromHashWithInfo = function(hash, cb) {
var self = this;
rpc.getBlock(hash, function(err, info) {
// Not found?
if (err && err.code === -5) return cb();
@ -146,9 +148,16 @@ function spec(b) {
if (info.result.height)
info.result.reward = BitcoreBlock.getBlockValue(info.result.height) / util.COIN ;
return cb(null, {
hash: hash,
info: info.result,
self.isMain(hash, function(err, val) {
if (err) return cb(err);
info.result.isMainChain = val ? true : false;
return cb(null, {
hash: hash,
info: info.result,
});
});
});
};

View File

@ -45,7 +45,9 @@
</tr>
<tr>
<td> <strong> Height </strong></td>
<td class="text-right text-muted">{{block.height}}</td>
<td class="text-right text-muted">{{block.height}}
<span data-ng-show="block.isMainChain" class="text-success">(Mainchain)</span>
<span data-ng-show="!block.isMainChain" class="text-danger"> <span class="glyphicon glyphicon-warning-sign"></span> (Orphaned)</span>
</tr>
<tr>
<td> <strong> Block Reward </strong></td>