all tests passing

This commit is contained in:
Manuel Araoz 2014-06-18 10:21:26 -03:00
commit b7af51ceee
3 changed files with 20 additions and 6 deletions

View file

@ -181,6 +181,7 @@ TxProposals.prototype.merge = function(inTxp) {
var v1 = inTxp;
ret = v0.merge(v1);
} else {
this.txps[ntxid] = inTxp;
ret.hasChanged = true;
ret.events.push({
type: 'new',

View file

@ -366,6 +366,7 @@ Wallet.prototype.sendAllTxProposals = function(recipients) {
Wallet.prototype.sendTxProposal = function(ntxid, recipients) {
preconditions.checkArgument(ntxid);
preconditions.checkState(this.txProposals.txps[ntxid]);
this.log('### SENDING txProposal '+ntxid+' TO:', recipients || 'All', this.txProposals);
this.network.send(recipients, {
type: 'txProposal',
@ -437,8 +438,8 @@ Wallet.prototype.generateAddress = function(isChange, cb) {
Wallet.prototype.getTxProposals = function() {
var ret = [];
var copayers = this.getRegisteredCopayerIds();
for (var k in this.txProposals.txps) {
var txp = this.txProposals.getTxProposal(k, copayers);
for (var ntxid in this.txProposals.txps) {
var txp = this.txProposals.getTxProposal(ntxid, copayers);
txp.signedByUs = txp.signedBy[this.getMyCopayerId()] ? true : false;
txp.rejectedByUs = txp.rejectedBy[this.getMyCopayerId()] ? true : false;
if (this.totalCopayers - txp.rejectCount < this.requiredCopayers) {