better handling of sign/broadcast fail
This commit is contained in:
parent
956c929db3
commit
4a1ab0eb16
1 changed files with 12 additions and 11 deletions
|
|
@ -323,8 +323,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
});
|
});
|
||||||
|
|
||||||
modalInstance.result.then(function(txp) {
|
modalInstance.result.then(function(txp) {
|
||||||
var refreshUntilItChanges = txp.refreshUntilItChanges;
|
var refreshUntilItChanges = txp ? txp.refreshUntilItChanges : null;
|
||||||
console.log('[walletHome.js.323:refreshUntilItChanges:]', refreshUntilItChanges); //TODO
|
|
||||||
self.setOngoingProcess();
|
self.setOngoingProcess();
|
||||||
if (txp) {
|
if (txp) {
|
||||||
txStatus.notify(txp, function() {
|
txStatus.notify(txp, function() {
|
||||||
|
|
@ -614,12 +613,16 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
}
|
}
|
||||||
|
|
||||||
self.signAndBroadcast(txp, function(err) {
|
self.signAndBroadcast(txp, function(err) {
|
||||||
if (err) {
|
self.setOngoingProcess();
|
||||||
self.setOngoingProcess();
|
profileService.lockFC();
|
||||||
return self.setSendError(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
self.resetForm();
|
self.resetForm();
|
||||||
|
if (err) {
|
||||||
|
self.error = err.message ? err.message : gettext('The payment was created but could not be completed. Please try again from home screen');
|
||||||
|
$scope.$emit('Local/TxProposalAction');
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.$digest();
|
||||||
|
}, 1);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
@ -631,20 +634,18 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
self.setOngoingProcess(gettext('Signing transaction'));
|
self.setOngoingProcess(gettext('Signing transaction'));
|
||||||
fc.signTxProposal(txp, function(err, signedTx) {
|
fc.signTxProposal(txp, function(err, signedTx) {
|
||||||
profileService.lockFC();
|
profileService.lockFC();
|
||||||
|
self.setOngoingProcess();
|
||||||
if (err) {
|
if (err) {
|
||||||
self.setOngoingProcess();
|
err.message = gettext('The payment was created but could not be signed. Please try again from home screen.') + (err.message ? ' ' + err.message : '');
|
||||||
return cb(err);
|
return cb(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (signedTx.status == 'accepted') {
|
if (signedTx.status == 'accepted') {
|
||||||
self.setOngoingProcess(gettext('Broadcasting transaction'));
|
self.setOngoingProcess(gettext('Broadcasting transaction'));
|
||||||
|
|
||||||
fc.broadcastTxProposal(signedTx, function(err, btx, memo) {
|
fc.broadcastTxProposal(signedTx, function(err, btx, memo) {
|
||||||
self.setOngoingProcess();
|
self.setOngoingProcess();
|
||||||
if (err) {
|
if (err) {
|
||||||
$scope.error = gettext('Transaction not broadcasted. Please try again.');
|
err.message = gettext('The payment was signed but could not be broadcasted. Please try again from home screen.') + (err.message ? ' ' + err.message : '');
|
||||||
$scope.$digest();
|
|
||||||
return cb(err);
|
return cb(err);
|
||||||
}
|
}
|
||||||
if (memo)
|
if (memo)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue