mirror of https://github.com/BTCPrivate/copay.git
compute alternative currency for pending txps
This commit is contained in:
parent
67b392bdc3
commit
9db19422e4
|
@ -324,6 +324,17 @@ angular.module('copayApp.services')
|
||||||
};
|
};
|
||||||
|
|
||||||
root.updateTxs = function(opts) {
|
root.updateTxs = function(opts) {
|
||||||
|
function computeAlternativeAmount(w, tx, cb) {
|
||||||
|
rateService.whenAvailable(function() {
|
||||||
|
_.each(tx.outs, function(out) {
|
||||||
|
var valueSat = out.value * w.settings.unitToSatoshi;
|
||||||
|
out.alternativeAmount = rateService.toFiat(valueSat, w.settings.alternativeIsoCode);
|
||||||
|
out.alternativeIsoCode = w.settings.alternativeIsoCode;
|
||||||
|
});
|
||||||
|
if (cb) return cb();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
var w = opts.wallet || $rootScope.wallet;
|
var w = opts.wallet || $rootScope.wallet;
|
||||||
if (!w) return;
|
if (!w) return;
|
||||||
opts = opts || $rootScope.txsOpts || {};
|
opts = opts || $rootScope.txsOpts || {};
|
||||||
|
@ -364,6 +375,9 @@ angular.module('copayApp.services')
|
||||||
i.fee = i.builder.feeSat * satToUnit;
|
i.fee = i.builder.feeSat * satToUnit;
|
||||||
i.missingSignatures = tx.countInputMissingSignatures(0);
|
i.missingSignatures = tx.countInputMissingSignatures(0);
|
||||||
i.actionList = getActionList(i.peerActions);
|
i.actionList = getActionList(i.peerActions);
|
||||||
|
if (i.isPending) {
|
||||||
|
computeAlternativeAmount(w, i);
|
||||||
|
}
|
||||||
txs.push(i);
|
txs.push(i);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue