Merge pull request #712 from maraoz/txp/protocol/security2
Improve tx proposal protocol security
This commit is contained in:
commit
0d54875bf2
5 changed files with 86 additions and 54 deletions
|
|
@ -118,13 +118,18 @@ Wallet.prototype._handlePublicKeyRing = function(senderId, data, isInbound) {
|
|||
|
||||
|
||||
Wallet.prototype._handleTxProposal = function(senderId, data) {
|
||||
preconditions.checkArgument(senderId);
|
||||
this.log('RECV TXPROPOSAL:', data);
|
||||
|
||||
var inTxp = TxProposals.TxProposal.fromObj(data.txProposal);
|
||||
|
||||
var mergeInfo = this.txProposals.merge(inTxp);
|
||||
var mergeInfo = this.txProposals.merge(inTxp, senderId);
|
||||
var added = this.addSeenToTxProposals();
|
||||
|
||||
if (added) {
|
||||
this.log('### BROADCASTING txProposals with my seenBy updated.');
|
||||
this.sendTxProposal(inTxp.getID());
|
||||
}
|
||||
|
||||
this.emit('txProposalsUpdated');
|
||||
this.store();
|
||||
|
||||
|
|
@ -499,6 +504,7 @@ Wallet.prototype.reject = function(ntxid) {
|
|||
|
||||
|
||||
Wallet.prototype.sign = function(ntxid, cb) {
|
||||
preconditions.checkState(typeof this.getMyCopayerId() !== 'undefined');
|
||||
var self = this;
|
||||
setTimeout(function() {
|
||||
var myId = self.getMyCopayerId();
|
||||
|
|
@ -711,7 +717,6 @@ Wallet.prototype.createTxSync = function(toAddress, amountSatStr, comment, utxos
|
|||
}]);
|
||||
|
||||
var selectedUtxos = b.getSelectedUnspent();
|
||||
|
||||
var inputChainPaths = selectedUtxos.map(function(utxo) {
|
||||
return pkr.pathForAddress(utxo.address);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue