From 397863fd9deb11f95b51c5f0732da15b318ebf1c Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Mon, 23 May 2016 09:59:13 -0300 Subject: [PATCH] update check params code --- lib/server.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/server.js b/lib/server.js index 44d7825..9ee11a6 100644 --- a/lib/server.js +++ b/lib/server.js @@ -2054,8 +2054,7 @@ WalletService.prototype.getTx = function(opts, cb) { WalletService.prototype.editTxNote = function(opts, cb) { var self = this; - if (!Utils.checkRequired(opts, ['txid'])) - return cb(new ClientError('Required argument missing')); + if (!checkRequired(opts, 'txid', cb)) return; self._runLocked(cb, function(cb) { self.storage.fetchTxNote(self.walletId, opts.txid, function(err, note) { @@ -2084,9 +2083,7 @@ WalletService.prototype.editTxNote = function(opts, cb) { WalletService.prototype.getTxNote = function(opts, cb) { var self = this; - if (!Utils.checkRequired(opts, ['txid'])) - return cb(new ClientError('Required argument missing')); - + if (!checkRequired(opts, 'txid', cb)) return; self.storage.fetchTxNote(self.walletId, opts.txid, cb); };