epidemic-broadcast-trees
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -85,3 +85,5 @@ 'use strict' | ||
if(isNote(states[k].effect)) { | ||
get(k, states[k].effect, function (err, msg) { | ||
var seq = states[k].effect | ||
states[k].effect = null | ||
get(k, seq, function (err, msg) { | ||
if(msg) { | ||
@@ -249,3 +251,1 @@ maybeQueue(k, states[k] = S.gotMessage(states[k], msg)) | ||
{ | ||
"name": "epidemic-broadcast-trees", | ||
"description": "", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"homepage": "https://github.com/dominictarr/epidemic-broadcast-trees", | ||
@@ -6,0 +6,0 @@ "repository": { |
17
state.js
@@ -104,4 +104,5 @@ 'use strict' | ||
if(isMessage(state.ready)) { | ||
if(state.ready.sequence <= msg.sequence) | ||
if(state.ready.sequence <= msg.sequence) { | ||
state.ready = null | ||
} | ||
} | ||
@@ -111,4 +112,5 @@ if(isOldMessage(state, msg)) { | ||
//let read move us out of tx mode, | ||
if(state.remote.tx) | ||
if(state.remote.tx) { | ||
_state.ready = -(seq + 1) | ||
} | ||
//XXX: there might be a race here if we are cancelling this feed | ||
@@ -121,7 +123,9 @@ } | ||
_state.effect = msg | ||
if(state.remote.tx == false) | ||
if(state.remote.tx == false) { | ||
state.ready = state.local.seq | ||
} | ||
} | ||
else { | ||
//this means something went really wrong | ||
console.log('WRONG MESSAGE', msg, state) | ||
_state.error = true | ||
@@ -169,4 +173,8 @@ } | ||
var _state = clone(state) | ||
//this shouldn't really happen, but this is a hack | ||
//to support recent changes to secure-scuttlebutt. | ||
if(msg.sequence <= _state.local.seq) | ||
return _state | ||
_state.local.seq = msg.sequence | ||
if(state.local.tx) { | ||
@@ -224,2 +232,1 @@ if(isNextTxMessage(state, msg)) { | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62408
26
1586