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) {
|
||||
var self = this;
|
||||
|
||||
rpc.getBlock(hash, function(err, info) {
|
||||
// Not found?
|
||||
if (err && err.code === -5) return cb();
|
||||
|
@ -146,11 +148,18 @@ function spec(b) {
|
|||
|
||||
if (info.result.height)
|
||||
info.result.reward = BitcoreBlock.getBlockValue(info.result.height) / util.COIN ;
|
||||
|
||||
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,
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
BlockDb.prototype.getBlocksByDate = function(start_ts, end_ts, limit, cb) {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue