Merge pull request #1856 from isocolsky/ref/update_txs

Various small fixes
This commit is contained in:
Matias Alejo Garcia 2014-11-21 11:05:23 -03:00
commit 6e099a7aa2
3 changed files with 24 additions and 27 deletions

View file

@ -1363,8 +1363,7 @@ Wallet.prototype.getPendingTxProposals = function() {
var txps = this.getTxProposals(); var txps = this.getTxProposals();
var satToUnit = 1 / this.settings.unitToSatoshi; var satToUnit = 1 / this.settings.unitToSatoshi;
_.find(txps, function(txp) { _.each(_.where(txps, 'isPending'), function(txp) {
if (txp.isPending) {
pendingForUs++; pendingForUs++;
var addresses = {}; var addresses = {};
var outs = JSON.parse(txp.builder.vanilla.outs); var outs = JSON.parse(txp.builder.vanilla.outs);
@ -1386,7 +1385,6 @@ Wallet.prototype.getPendingTxProposals = function() {
txp.missingSignatures = txp.builder.build().countInputMissingSignatures(0); txp.missingSignatures = txp.builder.build().countInputMissingSignatures(0);
txp.actionList = self._getActionList(txp.peerActions); txp.actionList = self._getActionList(txp.peerActions);
ret.txs.push(txp); ret.txs.push(txp);
}
}); });
ret.pendingForUs = pendingForUs; ret.pendingForUs = pendingForUs;

View file

@ -65,7 +65,7 @@ angular.module('copayApp.services')
root.updateTxsAndBalance = function(w) { root.updateTxsAndBalance = function(w) {
root.updateTxs(); root.updateTxs(w);
root.updateBalance(w, function() { root.updateBalance(w, function() {
$rootScope.$digest(); $rootScope.$digest();
}); });
@ -356,8 +356,8 @@ angular.module('copayApp.services')
}); });
}; };
root.updateTxs = function() { root.updateTxs = function(w) {
var w = $rootScope.wallet; w = w || $rootScope.wallet;
if (!w) return root.onErrorDigest(); if (!w) return root.onErrorDigest();
var res = w.getPendingTxProposals(); var res = w.getPendingTxProposals();
_.each(res.txs, function(tx) { _.each(res.txs, function(tx) {

View file

@ -120,5 +120,4 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>