From 88f972e7d320c7362f6c018a7ac56d39faf5d3d0 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Fri, 18 Dec 2015 12:41:45 -0300 Subject: [PATCH] use getTotalAmount() instead of amount field --- lib/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/server.js b/lib/server.js index 4210567..96153dc 100644 --- a/lib/server.js +++ b/lib/server.js @@ -1241,7 +1241,7 @@ WalletService.prototype._selectTxInputs = function(txp, utxosToExclude, cb) { } if (totalAmount < txp.getTotalAmount()) return cb(Errors.INSUFFICIENT_FUNDS); - if (availableAmount < txp.amount) return cb(Errors.LOCKED_FUNDS); + if (availableAmount < txp.getTotalAmount()) return cb(Errors.LOCKED_FUNDS); // Prepare UTXOs list utxos = _.reject(utxos, 'locked'); @@ -2088,7 +2088,7 @@ WalletService.prototype.getTxHistory = function(opts, cb) { var self = this; opts = opts || {}; - opts.limit = (_.isUndefined(opts.limit) ? HISTORY_LIMIT : opts.limit); + opts.limit = (_.isUndefined(opts.limit) ? HISTORY_LIMIT : opts.limit); if (opts.limit > HISTORY_LIMIT) return cb(Errors.HISTORY_LIMIT_EXCEEDED);