diff --git a/index.html b/index.html index 15af8e066..a88a9fb03 100644 --- a/index.html +++ b/index.html @@ -249,11 +249,13 @@
| {{out.value}} | ++ | {{out.address}} |
|
diff --git a/js/controllers/transactions.js b/js/controllers/transactions.js
index d4356a62a..7cc47598e 100644
--- a/js/controllers/transactions.js
+++ b/js/controllers/transactions.js
@@ -5,8 +5,9 @@ angular.module('copay.transactions').controller('TransactionsController',
function($scope, $rootScope, $location) {
$scope.title = 'Transactions';
var _updateTxs = function() {
-console.log('[transactions.js.10:_updateTxs:]'); //TODO
var w =$rootScope.wallet;
+ if (!w) return;
+
var inT = w.getTxProposals();
var txs = [];
@@ -25,11 +26,10 @@ console.log('[transactions.js.10:_updateTxs:]'); //TODO
});
// extra fields
i.outs = outs;
- i.fee = i.feeSat/bitcore.util.COIN;
+ i.fee = i.builder.feeSat/bitcore.util.COIN;
i.missingSignatures = tx.countInputMissingSignatures(0);
txs.push(i);
});
-console.log('[transactions.js.35:txs:]',txs); //TODO
$scope.txs = txs;
w.removeListener('txProposalsUpdated',_updateTxs)
w.once('txProposalsUpdated',_updateTxs);
@@ -38,7 +38,7 @@ console.log('[transactions.js.35:txs:]',txs); //TODO
$scope.send = function (ntxid) {
var w = $rootScope.wallet;
w.sendTx(ntxid, function(txid) {
-console.log('[transactions.js.68:txid:] SENTTX CALLBACK',txid); //TODO
+ console.log('[transactions.js.68:txid:] SENTTX CALLBACK',txid); //TODO
$rootScope.flashMessage = txid
? {type:'success', message: 'Transactions SENT! txid:' + txid}
: {type:'error', message: 'There was an error sending the Transaction'}
@@ -51,17 +51,20 @@ console.log('[transactions.js.68:txid:] SENTTX CALLBACK',txid); //TODO
$scope.sign = function (ntxid) {
var w = $rootScope.wallet;
var ret = w.sign(ntxid);
- _updateTxs();
+ if (!ret) {
+ $rootScope.flashMessage = {type:'error', message: 'There was an error signing the Transaction'};
+ _updateTxs();
+ $rootScope.$digest();
+ return;
+ }
var p = w.getTxProposal(ntxid);
if (p.txp.builder.isFullySigned()) {
$scope.send(ntxid);
+ _updateTxs();
+ $rootScope.$digest();
}
else {
- $rootScope.flashMessage = ret
- ? {type:'success', message: 'Transactions signed'}
- : {type:'error', message: 'There was an error signing the Transaction'}
- ;
_updateTxs();
$rootScope.$digest();
}
diff --git a/js/models/core/PrivateKey.js b/js/models/core/PrivateKey.js
index 2002a14b6..0e2d87631 100644
--- a/js/models/core/PrivateKey.js
+++ b/js/models/core/PrivateKey.js
@@ -71,7 +71,6 @@ PrivateKey.prototype.get = function(index,isChange) {
PrivateKey.prototype.getAll = function(addressIndex, changeAddressIndex) {
var ret = [];
-
for(var i=0;i |