|
|
@ -23,7 +23,7 @@ function TxProposal(opts) { |
|
|
|
this.inputs = opts.inputs; |
|
|
|
this.inputPaths = opts.inputPaths; |
|
|
|
this.requiredSignatures = opts.requiredSignatures; |
|
|
|
this.maxRejections = opts.maxRejections; |
|
|
|
this.requiredRejections = opts.requiredRejections; |
|
|
|
this.status = 'pending'; |
|
|
|
this.actions = {}; |
|
|
|
}; |
|
|
@ -41,7 +41,7 @@ TxProposal.fromObj = function(obj) { |
|
|
|
x.changeAddress = obj.changeAddress; |
|
|
|
x.inputs = obj.inputs; |
|
|
|
x.requiredSignatures = obj.requiredSignatures; |
|
|
|
x.maxRejections = obj.maxRejections; |
|
|
|
x.requiredRejections = obj.requiredRejections; |
|
|
|
x.status = obj.status; |
|
|
|
x.txid = obj.txid; |
|
|
|
x.inputPaths = obj.inputPaths; |
|
|
@ -157,7 +157,7 @@ TxProposal.prototype.isAccepted = function() { |
|
|
|
|
|
|
|
TxProposal.prototype.isRejected = function() { |
|
|
|
var votes = _.countBy(_.values(this.actions), 'type'); |
|
|
|
return votes['reject'] > this.maxRejections; |
|
|
|
return votes['reject'] >= this.requiredRejections; |
|
|
|
}; |
|
|
|
|
|
|
|
TxProposal.prototype.setBroadcasted = function(txid) { |
|
|
|