Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
swarm: bugfix on timeout accounting
Browse files Browse the repository at this point in the history
  • Loading branch information
flavioribeiro committed Oct 23, 2014
1 parent c8941e4 commit d587b63
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,9 @@ class Swarm extends BaseObject {
} else {
// nothing could be worse than this. Someont sent you the entire chunk, but missed the time
// and generated unnecessary traffic. Putting peer on the end of the swarm.
if (this.satisfyElected === undefined && this.currentResource === undefined) {
if (this.satisfyElected === undefined || this.currentResource === undefined) {
log.warn("satisfy error: timeout")
peer.late += 1
} else if (peer.ident !== this.satisfyElected) {
log.warn("satisfy error: wrong satisfy elected (" + peer.ident + "," + this.satisfyElected + ")")
} else {
log.warn("satisfy error: wrong resource")
}
Expand Down

0 comments on commit d587b63

Please sign in to comment.