Skip to content

Commit

Permalink
Merge pull request #1497 from isocolsky/fea/no_broadcast
Browse files Browse the repository at this point in the history
When only 1 signature is required, broadcast at creation
  • Loading branch information
cmgustavo committed Oct 2, 2014
2 parents 76e98d6 + b15c620 commit 90c01ae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/controllers/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ angular.module('copayApp.controllers').controller('SendController',
});
}

if (w.isShared()) {
if (w.requiresMultipleSignatures()) {
$scope.loading = false;
var message = 'The transaction proposal has been created';
if (merchantData) {
Expand Down
8 changes: 8 additions & 0 deletions js/models/Wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -2472,6 +2472,14 @@ Wallet.prototype.isShared = function() {
return this.totalCopayers > 1;
};

/**
* @desc Returns true if more than one signature is required
* @return {boolean}
*/
Wallet.prototype.requiresMultipleSignatures = function() {
return this.requiredCopayers > 1;
};

/**
* @desc Returns true if the keyring is complete and all users have backed up the wallet
* @return {boolean}
Expand Down
4 changes: 4 additions & 0 deletions test/mocks/FakeWallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ FakeWallet.prototype.isShared = function() {
return this.totalCopayers > 1;
}

FakeWallet.prototype.requiresMultipleSignatures = function() {
return this.requiredCopayers > 1;
};

FakeWallet.prototype.isReady = function() {
return true;
};
Expand Down

0 comments on commit 90c01ae

Please sign in to comment.