diff --git a/lib/db/lowlevelup.js b/lib/db/lowlevelup.js index 8e6e3cec..3b231edb 100644 --- a/lib/db/lowlevelup.js +++ b/lib/db/lowlevelup.js @@ -59,6 +59,7 @@ function LowlevelUp(backend, location, options) { LowlevelUp.prototype.init = function init() { const Backend = this.backend; + let db = new Backend(this.location); let binding = db; diff --git a/lib/http/base.js b/lib/http/base.js index 107c7857..bb8c1ef0 100644 --- a/lib/http/base.js +++ b/lib/http/base.js @@ -366,6 +366,7 @@ HTTPBase.prototype.readBody = function readBody(req, enc, options) { HTTPBase.prototype._readBody = function _readBody(req, enc, options, resolve, reject) { const decode = new StringDecoder(enc); + let hasData = false; let total = 0; let body = ''; @@ -1256,6 +1257,7 @@ Request.prototype.init = function init(req, res, url) { Request.prototype.parse = function parse(url) { const uri = URL.parse(url); + let pathname = uri.pathname; let query = Object.create(null); let trailing = false; diff --git a/lib/wallet/http.js b/lib/wallet/http.js index 1fc55bd2..e00d0d78 100644 --- a/lib/wallet/http.js +++ b/lib/wallet/http.js @@ -380,7 +380,7 @@ HTTPServer.prototype.initRouter = function initRouter() { this.post('/:id/send', async (req, res) => { const valid = req.valid(); const passphrase = valid.str('passphrase'); - const outputs = valid.array('outputs'); + const outputs = valid.array('outputs', []); const options = { rate: valid.u64('rate'), @@ -397,6 +397,7 @@ HTTPServer.prototype.initRouter = function initRouter() { for (const output of outputs) { const valid = new Validator([output]); const raw = valid.buf('script'); + let script = null; if (raw) @@ -420,7 +421,7 @@ HTTPServer.prototype.initRouter = function initRouter() { this.post('/:id/create', async (req, res) => { const valid = req.valid(); const passphrase = valid.str('passphrase'); - const outputs = valid.array('outputs'); + const outputs = valid.array('outputs', []); const options = { rate: valid.u64('rate'), @@ -436,6 +437,7 @@ HTTPServer.prototype.initRouter = function initRouter() { for (const output of outputs) { const valid = new Validator([output]); const raw = valid.buf('script'); + let script = null; if (raw) @@ -870,7 +872,7 @@ HTTPServer.prototype.handleSocket = function handleSocket(socket) { socket.auth = true; - this.logger.info('Successful auth from %s.', socket.host); + this.logger.info('Successful auth from %s.', socket.remoteAddress); this.handleAuth(socket);