From 9fee035c5815729aeee979a040c05db944115d8d Mon Sep 17 00:00:00 2001 From: Stefan Thomas Date: Thu, 18 Aug 2011 04:57:58 +0100 Subject: [PATCH] Added utility function for TransactionDatabase reset. --- src/txdb.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/txdb.js b/src/txdb.js index aff2784..bb5feae 100755 --- a/src/txdb.js +++ b/src/txdb.js @@ -54,3 +54,9 @@ TransactionDatabase.prototype.loadTransactions = function (txs) { TransactionDatabase.prototype.getTransactions = function () { return this.txs; }; + +TransactionDatabase.prototype.clear = function () { + this.txs = []; + this.txIndex = {}; + $(this).trigger('update'); +};