Skip to content

Commit

Permalink
When only 1 signature is required, broadcast at creation
Browse files Browse the repository at this point in the history
  • Loading branch information
isocolsky committed Sep 29, 2014
1 parent f3f03af commit b15c620
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 @@ -2475,6 +2475,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 b15c620

Please sign in to comment.