Fix creating transaction with no priv key
This commit is contained in:
parent
1cace8ac37
commit
92a21046b2
3 changed files with 26 additions and 25 deletions
|
|
@ -485,14 +485,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wallet.canSign() && !wallet.isPrivKeyExternal()) {
|
|
||||||
$log.info('No signing proposal: No private key');
|
|
||||||
|
|
||||||
return walletService.onlyPublish(wallet, txp, function(err, txp) {
|
|
||||||
if (err) return setSendError(err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
ongoingProcess.set('creatingTx', true, onSendStatusChange);
|
ongoingProcess.set('creatingTx', true, onSendStatusChange);
|
||||||
createTx(wallet, false, function(err, txp) {
|
createTx(wallet, false, function(err, txp) {
|
||||||
ongoingProcess.set('creatingTx', false, onSendStatusChange);
|
ongoingProcess.set('creatingTx', false, onSendStatusChange);
|
||||||
|
|
@ -539,7 +531,12 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
|
|
||||||
function statusChangeHandler(processName, showName, isOn) {
|
function statusChangeHandler(processName, showName, isOn) {
|
||||||
$log.debug('statusChangeHandler: ', processName, showName, isOn);
|
$log.debug('statusChangeHandler: ', processName, showName, isOn);
|
||||||
if ((processName === 'broadcastingTx' || ((processName === 'signingTx') && $scope.wallet.m > 1)) && !isOn) {
|
if (
|
||||||
|
(
|
||||||
|
processName === 'broadcastingTx' ||
|
||||||
|
((processName === 'signingTx') && $scope.wallet.m > 1) ||
|
||||||
|
(processName == 'sendingTx' && !$scope.wallet.canSign() && !$scope.wallet.isPrivKeyExternal())
|
||||||
|
) && !isOn) {
|
||||||
$scope.sendStatus = 'success';
|
$scope.sendStatus = 'success';
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
} else if (showName) {
|
} else if (showName) {
|
||||||
|
|
@ -760,6 +757,15 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
};
|
};
|
||||||
|
|
||||||
function publishAndSign(wallet, txp, onSendStatusChange) {
|
function publishAndSign(wallet, txp, onSendStatusChange) {
|
||||||
|
|
||||||
|
if (!wallet.canSign() && !wallet.isPrivKeyExternal()) {
|
||||||
|
$log.info('No signing proposal: No private key');
|
||||||
|
|
||||||
|
return walletService.onlyPublish(wallet, txp, function(err) {
|
||||||
|
if (err) setSendError(err);
|
||||||
|
}, onSendStatusChange);
|
||||||
|
}
|
||||||
|
|
||||||
walletService.publishAndSign(wallet, txp, function(err, txp) {
|
walletService.publishAndSign(wallet, txp, function(err, txp) {
|
||||||
if (err) return setSendError(err);
|
if (err) return setSendError(err);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -889,20 +889,14 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
root.onlyPublish = function(wallet, txp, cb) {
|
root.onlyPublish = function(wallet, txp, cb, customStatusHandler) {
|
||||||
ongoingProcess.set('sendingTx', true);
|
ongoingProcess.set('sendingTx', true, customStatusHandler);
|
||||||
root.publishTx(wallet, txp, function(err, publishedTxp) {
|
root.publishTx(wallet, txp, function(err, publishedTxp) {
|
||||||
root.invalidateCache(wallet);
|
root.invalidateCache(wallet);
|
||||||
|
ongoingProcess.set('sendingTx', false, customStatusHandler);
|
||||||
ongoingProcess.set('sendingTx', false);
|
if (err) return cb(bwcError.msg(err));
|
||||||
if (err) return cb(err);
|
$rootScope.$emit('Local/TxAction', wallet.id);
|
||||||
|
return cb();
|
||||||
var type = root.getViewStatus(wallet, createdTxp);
|
|
||||||
root.openStatusModal(type, createdTxp, function() {
|
|
||||||
$rootScope.$emit('Local/TxAction', wallet.id);
|
|
||||||
return;
|
|
||||||
});
|
|
||||||
return cb(null, publishedTxp);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -137,8 +137,9 @@
|
||||||
slide-success-show="sendStatus === 'success'"
|
slide-success-show="sendStatus === 'success'"
|
||||||
slide-success-on-confirm="onSuccessConfirm()"
|
slide-success-on-confirm="onSuccessConfirm()"
|
||||||
slide-success-hide-on-confirm="true">
|
slide-success-hide-on-confirm="true">
|
||||||
<span ng-hide="wallet.m > 1">Payment Sent</span>
|
<span ng-show="wallet.m == 1 && (wallet.canSign() || wallet.isPrivKeyExternal())">Payment Sent</span>
|
||||||
<span ng-show="wallet.m > 1">Proposal Created</span>
|
<span ng-show="wallet.m > 1 && (wallet.canSign() || wallet.isPrivKeyExternal())">Proposal Created</span>
|
||||||
|
<span ng-show="!wallet.canSign() && !wallet.isPrivKeyExternal()">Transaction created</span>
|
||||||
<div ng-show="isGlidera" class="glidera-success">
|
<div ng-show="isGlidera" class="glidera-success">
|
||||||
<span ng-show="isGlidera == 'buy'">A transfer has been initiated from your bank account. Your bitcoins should arrive to your wallet in 2-4 business day</span>
|
<span ng-show="isGlidera == 'buy'">A transfer has been initiated from your bank account. Your bitcoins should arrive to your wallet in 2-4 business day</span>
|
||||||
<span ng-show="isGlidera == 'sell'">A transfer has been initiated to your bank account. Should arrive in 4-6 business days</span>
|
<span ng-show="isGlidera == 'sell'">A transfer has been initiated to your bank account. Should arrive in 4-6 business days</span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue