|
|
@ -222,7 +222,7 @@ CopayServer.prototype.joinWallet = function(opts, cb) { |
|
|
|
self.storage.fetchCopayerLookup(copayer.id, function(err, res) { |
|
|
|
if (err) return cb(err); |
|
|
|
if (res) |
|
|
|
return cb(new ClientError('CREGISTED', 'Copayer ID already registered on server')); |
|
|
|
return cb(new ClientError('CREGISTERED', 'Copayer ID already registered on server')); |
|
|
|
|
|
|
|
wallet.addCopayer(copayer); |
|
|
|
self.storage.storeWalletAndUpdateCopayersLookup(wallet, function(err) { |
|
|
@ -378,7 +378,7 @@ CopayServer.prototype._getUtxos = function(cb) { |
|
|
|
// Needed for the clients to sign UTXOs
|
|
|
|
_.each(utxos, function(utxo) { |
|
|
|
utxo.satoshis = utxo.satoshis ? +utxo.satoshis : Utils.strip(utxo.amount * 1e8); |
|
|
|
delete utxo.amount; |
|
|
|
delete utxo.amount; |
|
|
|
utxo.path = addressToPath[utxo.address].path; |
|
|
|
utxo.publicKeys = addressToPath[utxo.address].publicKeys; |
|
|
|
}); |
|
|
@ -497,7 +497,8 @@ CopayServer.prototype.createTx = function(opts, cb) { |
|
|
|
toAddress: opts.toAddress, |
|
|
|
amount: opts.amount, |
|
|
|
message: opts.message, |
|
|
|
changeAddress: changeAddress.address, |
|
|
|
proposalSignature: opts.proposalSignature, |
|
|
|
changeAddress: changeAddress, |
|
|
|
requiredSignatures: wallet.m, |
|
|
|
requiredRejections: Math.min(wallet.m, wallet.n - wallet.m + 1), |
|
|
|
}); |
|
|
@ -655,6 +656,7 @@ CopayServer.prototype.signTx = function(opts, cb) { |
|
|
|
copayerId: self.copayerId, |
|
|
|
}); |
|
|
|
|
|
|
|
// TODO: replace with .isAccepted()
|
|
|
|
if (txp.status == 'accepted') { |
|
|
|
|
|
|
|
self._notify('TxProposalFinallyAccepted', { |
|
|
|