From c2c06f732bf2e522e0b7d2f7eff7b2c64e7ca537 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 20 Oct 2016 10:01:45 -0700 Subject: [PATCH] wallet: comments. --- lib/chain/chaindb.js | 1 + lib/wallet/wallet.js | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/lib/chain/chaindb.js b/lib/chain/chaindb.js index b29a2ce5..b3fc274a 100644 --- a/lib/chain/chaindb.js +++ b/lib/chain/chaindb.js @@ -1099,6 +1099,7 @@ ChainDB.prototype.scan = co(function* scan(start, filter, iter) { } yield iter(entry, txs); + entry = yield entry.getNext(); } diff --git a/lib/wallet/wallet.js b/lib/wallet/wallet.js index 6b8856ab..79f6b7d4 100644 --- a/lib/wallet/wallet.js +++ b/lib/wallet/wallet.js @@ -1747,7 +1747,7 @@ Wallet.prototype.sign = co(function* sign(tx, passphrase) { }); /** - * Fill transaction with coins (accesses db). + * Fill transaction with coins. * @param {TX} tx * @returns {Promise} - Returns {@link TX}. */ @@ -1757,7 +1757,7 @@ Wallet.prototype.fillCoins = function fillCoins(tx) { }; /** - * Fill transaction with historical coins (accesses db). + * Fill transaction with historical coins. * @param {TX} tx * @returns {Promise} - Returns {@link TX}. */ @@ -1767,9 +1767,9 @@ Wallet.prototype.fillHistory = function fillHistory(tx) { }; /** - * Fill transaction with historical coins (accesses db). + * Convert transaction to transaction details. * @param {TX} tx - * @returns {Promise} - Returns {@link TX}. + * @returns {Promise} - Returns {@link Details}. */ Wallet.prototype.toDetails = function toDetails(tx) { @@ -1777,17 +1777,17 @@ Wallet.prototype.toDetails = function toDetails(tx) { }; /** - * Fill transaction with historical coins (accesses db). - * @param {TX} tx - * @returns {Promise} - Returns {@link TX}. + * Get transaction details. + * @param {Hash} hash + * @returns {Promise} - Returns {@link Details}. */ -Wallet.prototype.getDetails = function getDetails(tx) { - return this.txdb.getDetails(tx); +Wallet.prototype.getDetails = function getDetails(hash) { + return this.txdb.getDetails(hash); }; /** - * Get a coin from the wallet (accesses db). + * Get a coin from the wallet. * @param {Hash} hash * @param {Number} index * @returns {Promise} - Returns {@link Coin}. @@ -1798,7 +1798,7 @@ Wallet.prototype.getCoin = function getCoin(hash, index) { }; /** - * Get a transaction from the wallet (accesses db). + * Get a transaction from the wallet. * @param {Hash} hash * @returns {Promise} - Returns {@link TX}. */ @@ -1808,7 +1808,7 @@ Wallet.prototype.getTX = function getTX(hash) { }; /** - * Add a transaction to the wallets TX history (accesses db). + * Add a transaction to the wallets TX history. * @param {TX} tx * @returns {Promise} */ @@ -1899,7 +1899,7 @@ Wallet.prototype.remove = co(function* remove(hash) { }); /** - * Zap stale TXs from wallet (accesses db). + * Zap stale TXs from wallet. * @param {(Number|String)?} acct * @param {Number} age - Age threshold (unix time, default=72 hours). * @returns {Promise} @@ -1928,7 +1928,7 @@ Wallet.prototype._zap = co(function* zap(acct, age) { }); /** - * Abandon transaction (accesses db). + * Abandon transaction. * @param {Hash} hash * @returns {Promise} */ @@ -1990,7 +1990,7 @@ Wallet.prototype.getLocked = function getLocked() { }; /** - * Get all transactions in transaction history (accesses db). + * Get all transactions in transaction history. * @param {(String|Number)?} acct * @returns {Promise} - Returns {@link TX}[]. */ @@ -2001,7 +2001,7 @@ Wallet.prototype.getHistory = co(function* getHistory(acct) { }); /** - * Get all available coins (accesses db). + * Get all available coins. * @param {(String|Number)?} account * @returns {Promise} - Returns {@link Coin}[]. */ @@ -2012,7 +2012,7 @@ Wallet.prototype.getCoins = co(function* getCoins(acct) { }); /** - * Get all pending/unconfirmed transactions (accesses db). + * Get all pending/unconfirmed transactions. * @param {(String|Number)?} acct * @returns {Promise} - Returns {@link TX}[]. */ @@ -2023,7 +2023,7 @@ Wallet.prototype.getPending = co(function* getPending(acct) { }); /** - * Get wallet balance (accesses db). + * Get wallet balance. * @param {(String|Number)?} acct * @returns {Promise} - Returns {@link Balance}. */ @@ -2034,7 +2034,7 @@ Wallet.prototype.getBalance = co(function* getBalance(acct) { }); /** - * Get a range of transactions between two timestamps (accesses db). + * Get a range of transactions between two timestamps. * @param {(String|Number)?} acct * @param {Object} options * @param {Number} options.start @@ -2053,7 +2053,7 @@ Wallet.prototype.getRange = co(function* getRange(acct, options) { }); /** - * Get the last N transactions (accesses db). + * Get the last N transactions. * @param {(String|Number)?} acct * @param {Number} limit * @returns {Promise} - Returns {@link TX}[].