diff --git a/js/models/Wallet.js b/js/models/Wallet.js
index ae31d25b3..e53f7a3cf 100644
--- a/js/models/Wallet.js
+++ b/js/models/Wallet.js
@@ -1324,7 +1324,10 @@ Wallet.prototype.getPendingTxProposals = function() {
});
txp.outs = [];
_.each(addresses, function(value, address) {
- txp.outs.push({address: address, value: value * satToUnit});
+ txp.outs.push({
+ address: address,
+ value: value * satToUnit
+ });
});
// extra fields
txp.fee = txp.builder.feeSat * satToUnit;
@@ -2933,12 +2936,16 @@ Wallet.prototype.getTransactionHistory = function(opts, cb) {
tx.action = amount > 0 ? 'sent' : 'received';
}
- var firstOut = _.findWhere(items, {
- type: 'out'
- });
+ if (tx.action == 'sent' || tx.action == 'moved') {
+ var firstOut = _.findWhere(items, {
+ type: 'out'
+ });
+ if (firstOut) {
+ tx.labelTo = firstOut.label;
+ tx.addressTo = firstOut.address;
+ }
+ };
- tx.labelTo = firstOut ? firstOut.label : undefined;
- tx.addressTo = firstOut ? firstOut.address : undefined;
tx.amountSat = Math.abs(amount);
tx.amount = tx.amountSat * satToUnit;
tx.minedTs = !_.isNaN(tx.time) ? tx.time * 1000 : undefined;
diff --git a/views/history.html b/views/history.html
index b8805bad5..99adf5746 100644
--- a/views/history.html
+++ b/views/history.html
@@ -100,7 +100,7 @@
-
+