Merge pull request #239 from matiu/bug/block-list

bug/blockslistapi
This commit is contained in:
Matias Alejo Garcia 2014-02-11 17:08:10 -02:00
commit ec2716318d
2 changed files with 13 additions and 2 deletions

View File

@ -115,7 +115,18 @@ exports.list = function(req, res) {
for(var i=0;i<limit;i++) {
blockshashList.push(blocks[i].hash);
}
async.mapSeries(blockshashList, getBlock, function(err, allblocks) {
async.mapSeries(blockshashList,
function(hash, cb) {
getBlock(hash, function(err, info) {
return cb(err,{
height: info.height,
size: info.size,
hash: info.hash,
time: info.time,
txlength: info.tx.length,
});
});
}, function(err, allblocks) {
res.jsonp({
blocks: allblocks,
length: allblocks.length,

View File

@ -42,7 +42,7 @@
<tr class="fader" data-ng-repeat='b in blocks'>
<td><a href="/block/{{b.hash}}">{{b.height}}</a></td>
<td>{{b.time * 1000 | date:'medium'}}</td>
<td>{{b.tx.length}}</td>
<td>{{b.txlength}}</td>
<td>{{b.size}}</td>
</tr>
</tbody>