count peer connection error, remove offline peers, content sign modification time fix, tracker order fix, reset peer hash_failed on download start, avoid util package name conflict

This commit is contained in:
HelloZeroNet 2015-01-13 21:19:40 +01:00
parent 6424c82887
commit 3f974e0bc7
5 changed files with 36 additions and 15 deletions

View file

@ -211,7 +211,7 @@ class Site:
else:
return False
else: # New peer
peer = Peer(ip, port)
peer = Peer(ip, port, self)
self.peers[key] = peer
return peer
@ -403,12 +403,11 @@ class Site:
# Generate new content.json
self.log.info("Adding timestamp and sha1sums to new content.json...")
import datetime, time
content = self.content.copy() # Create a copy of current content.json
content["address"] = self.address # Add files sha1 hash
content["files"] = hashed_files # Add files sha1 hash
content["modified"] = time.mktime(datetime.datetime.utcnow().utctimetuple()) # Add timestamp
content["modified"] = time.time() # Add timestamp
del(content["sign"]) # Delete old site
# Signing content

View file

@ -2,9 +2,9 @@ import json, logging, time, re, os
import gevent
TRACKERS = [
("udp", "sugoi.pomf.se", 2710), # Retry 3 times
("udp", "sugoi.pomf.se", 2710),
("udp", "sugoi.pomf.se", 2710),
("udp", "open.demonii.com", 1337), # Retry 3 times
("udp", "open.demonii.com", 1337),
("udp", "open.demonii.com", 1337),
("udp", "bigfoot1942.sektori.org", 6969),
("udp", "tracker.coppersurfer.tk", 80),