mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-28 08:05:51 +00:00
Remove unused methods from TransactionQueue
This commit is contained in:
@@ -19,6 +19,7 @@ function TransactionManager(account) {
|
||||
this._pending = new PendingQueue;
|
||||
this._nextSequence = void(0);
|
||||
this._cache = { };
|
||||
// ND: Do we ever clean this up?
|
||||
this._sequenceCache = { };
|
||||
this._maxFee = this._remote.max_fee;
|
||||
this._submissionTimeout = this._remote._submission_timeout;
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
|
||||
function TransactionQueue() {
|
||||
var self = this;
|
||||
|
||||
this._queue = [ ];
|
||||
|
||||
Object.defineProperty(this, '_length', {
|
||||
get: function() { return self._queue.length }
|
||||
});
|
||||
}
|
||||
|
||||
TransactionQueue.prototype.length = function() {
|
||||
@@ -24,50 +17,6 @@ TransactionQueue.prototype.getBySubmissions = function(hash) {
|
||||
return false;
|
||||
};
|
||||
|
||||
/*TransactionQueue.prototype.indexOf = function(prop, val) {
|
||||
var index = -1;
|
||||
for (var i=0, tx; tx=this._queue[i]; i++) {
|
||||
if (tx[prop] === val) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
};
|
||||
*/
|
||||
// ND: fixed `hash` vs _`hash`
|
||||
/*TransactionQueue.prototype.hasHash = function(hash) {
|
||||
return this.indexOf('_hash', hash) !== -1;
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
/*TransactionQueue.prototype.get = function(prop, val) {
|
||||
var index = this.indexOf(prop, val);
|
||||
return index > -1 ? this._queue[index] : false;
|
||||
};
|
||||
*/
|
||||
|
||||
// ND: These are unused
|
||||
/*TransactionQueue.prototype.removeSequence = function(sequence) {
|
||||
var result = [ ];
|
||||
for (var i=0, tx; tx=this._queue[i]; i++) {
|
||||
if (!tx.tx_json) continue;
|
||||
if (tx.tx_json.Sequence !== sequence) result.push(tx);
|
||||
}
|
||||
this._queue = result;
|
||||
};
|
||||
*/
|
||||
/*TransactionQueue.prototype.removeHash = function(hash) {
|
||||
var result = [ ];
|
||||
for (var i=0, tx; tx=this._queue[i]; i++) {
|
||||
if (!tx.tx_json) continue;
|
||||
if (tx.hash !== hash) result.push(tx);
|
||||
}
|
||||
this._queue = result;
|
||||
};
|
||||
*/
|
||||
|
||||
// ND: We are just removing the Transaction by identity
|
||||
TransactionQueue.prototype.remove = function(removedTx) {
|
||||
for (var i = this._queue.length - 1; i >= 0; i--) {
|
||||
@@ -86,4 +35,4 @@ TransactionQueue.prototype.push = function() {
|
||||
Array.prototype.push.apply(this._queue, arguments);
|
||||
};
|
||||
|
||||
exports.TransactionQueue = TransactionQueue;
|
||||
exports.TransactionQueue = TransactionQueue;
|
||||
Reference in New Issue
Block a user