shows orphan status on block page
This commit is contained in:
parent
31ec198f38
commit
0bbc9763b2
|
@ -139,6 +139,8 @@ function spec(b) {
|
||||||
|
|
||||||
|
|
||||||
BlockDb.prototype.fromHashWithInfo = function(hash, cb) {
|
BlockDb.prototype.fromHashWithInfo = function(hash, cb) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
rpc.getBlock(hash, function(err, info) {
|
rpc.getBlock(hash, function(err, info) {
|
||||||
// Not found?
|
// Not found?
|
||||||
if (err && err.code === -5) return cb();
|
if (err && err.code === -5) return cb();
|
||||||
|
@ -146,9 +148,16 @@ function spec(b) {
|
||||||
|
|
||||||
if (info.result.height)
|
if (info.result.height)
|
||||||
info.result.reward = BitcoreBlock.getBlockValue(info.result.height) / util.COIN ;
|
info.result.reward = BitcoreBlock.getBlockValue(info.result.height) / util.COIN ;
|
||||||
return cb(null, {
|
|
||||||
hash: hash,
|
self.isMain(hash, function(err, val) {
|
||||||
info: info.result,
|
if (err) return cb(err);
|
||||||
|
|
||||||
|
info.result.isMainChain = val ? true : false;
|
||||||
|
|
||||||
|
return cb(null, {
|
||||||
|
hash: hash,
|
||||||
|
info: info.result,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,7 +45,9 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> <strong> Height </strong></td>
|
<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>
|
||||||
<tr>
|
<tr>
|
||||||
<td> <strong> Block Reward </strong></td>
|
<td> <strong> Block Reward </strong></td>
|
||||||
|
|
Loading…
Reference in New Issue