wallet: remove getLastTime.

This commit is contained in:
Christopher Jeffrey 2016-08-26 05:08:07 -07:00
parent 06bb874573
commit 740e8012a2
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 0 additions and 49 deletions

View File

@ -1691,41 +1691,6 @@ TXDB.prototype.getAccountHistory = function getAccountHistory(account, callback)
});
};
/**
* Get last active timestamp and height.
* @param {Number?} account
* @param {Function} callback - Returns [Error, Number(ts), Number(height)].
*/
TXDB.prototype.getLastTime = function getLastTime(account, callback) {
var i, tx, lastTs, lastHeight;
if (typeof account === 'function') {
callback = account;
account = null;
}
this.getHistory(account, function(err, txs) {
if (err)
return callback(err);
lastTs = 0;
lastHeight = -1;
for (i = 0; i < txs.length; i++) {
tx = txs[i];
if (tx.ts > lastTs)
lastTs = tx.ts;
if (tx.height > lastHeight)
lastHeight = tx.height;
}
callback(null, lastTs, lastHeight);
});
};
/**
* Get unconfirmed transactions.
* @param {Number?} account

View File

@ -1624,20 +1624,6 @@ Wallet.prototype.getBalance = function getBalance(account, callback) {
});
};
/**
* Get last timestamp and height this wallet was active
* at (accesses db). Useful for resetting the chain
* to a certain height when in SPV mode.
* @param {(String|Number)?} account
* @param {Function} callback - Returns [Error, Number(ts), Number(height)].
*/
Wallet.prototype.getLastTime = function getLastTime(account, callback) {
this._getIndex(account, callback, function(account, callback) {
this.tx.getLastTime(account, callback);
});
};
/**
* Get a range of transactions between two timestamps (accesses db).
* @param {(String|Number)?} account