made wallet#sign synchronous

This commit is contained in:
Ivan Socolsky 2014-11-06 14:53:09 -03:00
commit 0db8c1008b
4 changed files with 64 additions and 68 deletions

View file

@ -445,20 +445,23 @@ angular.module('copayApp.controllers').controller('SendController',
$scope.sign = function(ntxid) {
$scope.loading = true;
w.sign(ntxid, function(ret) {
if (!ret) {
$scope.error = 'There was an error signing the transaction';
try {
w.sign(ntxid);
} catch (e) {
$scope.error = 'There was an error signing the transaction';
$scope.loadTxs();
return;
}
var p = w.txProposals.getTxProposal(ntxid);
if (p.builder.isFullySigned()) {
$scope.send(ntxid, function() {
$scope.loadTxs();
} else {
var p = w.txProposals.getTxProposal(ntxid);
if (p.builder.isFullySigned()) {
$scope.send(ntxid, function() {
$scope.loadTxs();
});
} else
$scope.loadTxs();
}
});
});
} else {
$scope.loadTxs();
}
};
$scope.reject = function(ntxid) {