Fix currency in path_rewrite

This commit is contained in:
wltsmrz
2013-09-05 15:20:17 -07:00
parent ceea368a5c
commit d89f04a622

View File

@@ -242,19 +242,19 @@ Transaction.prototype.destination_tag = function (tag) {
}
Transaction._path_rewrite = function (path) {
var props = [
'account'
, 'issuer'
, 'currency'
]
var path_new = path.map(function(node) {
var node_new = { };
for (var prop in node) {
if (~props.indexOf(prop)) {
node_new[prop] = UInt160.json_rewrite(node[prop]);
}
if (node.hasOwnProperty('account')) {
node_new.account = UInt160.json_rewrite(node.account);
}
if (node.hasOwnProperty('issuer')) {
node_new.issuer = UInt160.json_rewrite(node.issuer);
}
if (node.hasOwnProperty('currency')) {
node_new.currency = Currency.json_rewrite(node.currency);
}
return node_new;