From 6e4a9179c15f26a1d8d7fe5618ca21834c6a0ed4 Mon Sep 17 00:00:00 2001 From: wltsmrz Date: Mon, 17 Mar 2014 13:21:54 -0700 Subject: [PATCH] Generate transaction hash in account_tx automatic binary handling --- src/js/ripple/remote.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/ripple/remote.js b/src/js/ripple/remote.js index 0f192d7d..07e2464a 100644 --- a/src/js/ripple/remote.js +++ b/src/js/ripple/remote.js @@ -1016,6 +1016,7 @@ Remote.prototype.requestAccountTx = function(options, callback) { tx.meta = new SerializedObject(transaction.meta).to_json(); tx.tx = new SerializedObject(transaction.tx_blob).to_json(); tx.tx.ledger_index = transaction.ledger_index; + tx.tx.hash = Transaction.from_json(tx.tx).hash(); return tx; }; @@ -1032,12 +1033,14 @@ Remote.prototype.requestAccountTx = function(options, callback) { self.removeAllListeners('success'); self.once('success', function(res) { - res.transactions = res.transactions.filter(fn); - if (options.binary) { res.transactions = res.transactions.map(parseBinary); } + if (fn !== Boolean) { + res.transactions = res.transactions.filter(fn); + } + if (typeof options.map === 'function') { res.transactions = res.transactions.map(options.map); }