diff --git a/package.json b/package.json index de411691d..91cb7541f 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,8 @@ "multiaddr": "^2.0.3", "multipart-stream": "^2.0.1", "ndjson": "^1.4.3", - "peer-id": "^0.7.0", - "peer-info": "^0.7.1", + "peer-id": "^0.8.0", + "peer-info": "^0.8.0", "promisify-es6": "^1.0.2", "qs": "^6.3.0", "stream-http": "^2.4.1", diff --git a/src/api/block.js b/src/api/block.js index 3e2bd2b81..41c880408 100644 --- a/src/api/block.js +++ b/src/api/block.js @@ -27,13 +27,13 @@ module.exports = (send) => { return callback(err) } if (Buffer.isBuffer(res)) { - Block.create(res, callback) + callback(null, new Block(res)) } else { res.pipe(bl((err, data) => { if (err) { return callback(err) } - Block.create(data, callback) + callback(null, new Block(data)) })) } }) @@ -85,8 +85,7 @@ module.exports = (send) => { if (err) { return callback(err) } - - Block.create(block, callback) + callback(null, new Block(block)) }) }) }