remove Block from status

This commit is contained in:
tenthirtyone 2017-08-14 22:10:00 -04:00
parent 9045eacccd
commit 90adbf3ece

View File

@ -1,28 +1,7 @@
const Block = require('../../models/block.js');
const pkg = require('../../package.json');
const logger = require('../logger');
const MAX_BLOCKS = 200;
// Not dry, in multiple APIs. Refactor to db api
function getBlock(params, options, limit, cb) {
const defaultOptions = { _id: 0 };
if (!Number.isInteger(limit)) {
limit = MAX_BLOCKS;
}
Object.assign(defaultOptions, options);
Block.find(
params,
defaultOptions,
cb)
.sort({ height: -1 })
.limit(limit);
}
module.exports = function statusAPI(router) {
router.get('/status', (req, res) => {
res.json({