Limit peer reputation
This commit is contained in:
parent
6c2eae29f5
commit
47fcee4df8
1 changed files with 5 additions and 0 deletions
|
@ -65,6 +65,11 @@ class Peer(object):
|
||||||
|
|
||||||
# Connect to host
|
# Connect to host
|
||||||
def connect(self, connection=None):
|
def connect(self, connection=None):
|
||||||
|
if self.reputation < -10:
|
||||||
|
self.reputation = -10
|
||||||
|
if self.reputation > 10:
|
||||||
|
self.reputation = 10
|
||||||
|
|
||||||
if self.connection:
|
if self.connection:
|
||||||
self.log("Getting connection (Closing %s)..." % self.connection)
|
self.log("Getting connection (Closing %s)..." % self.connection)
|
||||||
self.connection.close("Connection change")
|
self.connection.close("Connection change")
|
||||||
|
|
Loading…
Reference in a new issue