diff --git a/lib/http/rpc.js b/lib/http/rpc.js index 6a36168f..c831a23b 100644 --- a/lib/http/rpc.js +++ b/lib/http/rpc.js @@ -3655,10 +3655,14 @@ RPC.prototype.listunspent = function listunspent(args, callback) { ? self.chain.height - coin.height + 1 : 0; - if (!(depth > minDepth && depth < maxDepth)) + if (!(depth >= minDepth && depth <= maxDepth)) return next(); address = coin.getAddress(); + + if (!address) + return next(); + hash = coin.getHash('hex'); if (addresses) { @@ -4092,7 +4096,7 @@ function toBool(obj, def) { } function toNumber(obj, def) { - if (!utils.isNumber(obj)) + if (utils.isNumber(obj)) return obj; return def != null ? def : -1; } diff --git a/lib/wallet/walletdb.js b/lib/wallet/walletdb.js index e7d282eb..d4e9ffd2 100644 --- a/lib/wallet/walletdb.js +++ b/lib/wallet/walletdb.js @@ -1533,7 +1533,7 @@ WalletDB.prototype.addTX = function addTX(tx, callback, force) { if (!wallet) return next(); - self.logger.debug('Adding tx to wallet: %s', info.wid); + self.logger.debug('Adding tx to wallet: %s', info.id); info.id = wallet.id;