broadcast txproposal 1 by 1

This commit is contained in:
Matias Alejo Garcia 2014-05-15 17:43:41 -03:00
commit 5154dc7085
3 changed files with 53 additions and 34 deletions

View file

@ -72,10 +72,17 @@ TxProposals.fromObj = function(o) {
return ret;
};
TxProposals.prototype.getNtxids = function() {
return Object.keys(this.txps);
};
TxProposals.prototype.toObj = function() {
TxProposals.prototype.toObj = function(onlyThisNtxid) {
var ret = [];
for(var id in this.txps){
if (onlyThisNtxid && id != onlyThisNtxid)
continue;
var t = this.txps[id];
if (!t.sent)
ret.push(t.toObj());
@ -87,7 +94,6 @@ TxProposals.prototype.toObj = function() {
};
};
TxProposals.prototype._startMerge = function(myTxps, theirTxps) {
var fromUs=0, fromTheirs=0, merged =0;
var toMerge = {}, ready={};