diff --git a/app/controllers/blocks.js b/app/controllers/blocks.js index d9c9f89..3a38d8d 100644 --- a/app/controllers/blocks.js +++ b/app/controllers/blocks.js @@ -13,10 +13,10 @@ var mongoose = require('mongoose'), * Find block by hash ... */ exports.block = function(req, res, next, hash) { - Block.fromHash(hash, function(err, block) { + Block.fromHashWithInfo(hash, function(err, block) { if (err) return next(err); if (!block) return next(new Error('Failed to load block ' + hash)); - req.block = block; + req.block = block.info; next(); }); }; diff --git a/app/controllers/transactions.js b/app/controllers/transactions.js index 8bf4635..6a4cffd 100644 --- a/app/controllers/transactions.js +++ b/app/controllers/transactions.js @@ -15,10 +15,10 @@ var Transaction = require('../models/Transaction'); * Find block by hash ... */ exports.transaction = function(req, res, next, txid) { - Transaction.fromID(txid, function(err, tx) { + Transaction.fromIdWithInfo(txid, function(err, tx) { if (err) return next(err); if (!tx) return next(new Error('Failed to load TX ' + txid)); - req.transaction = tx; + req.transaction = tx.info; next(); }); }; diff --git a/app/models/Block.js b/app/models/Block.js index 8705978..4353797 100644 --- a/app/models/Block.js +++ b/app/models/Block.js @@ -5,7 +5,6 @@ */ var mongoose = require('mongoose'), Schema = mongoose.Schema, - async = require('async'), RpcClient = require('bitcore/RpcClient').class(), config = require('../../config/config') ;