test
This commit is contained in:
parent
7738de1c28
commit
6e55636e78
9 changed files with 72 additions and 59 deletions
|
@ -63,14 +63,14 @@ class DaemonTools:
|
|||
logger.warn('Network check failed, are you connected to the internet?')
|
||||
self.daemon.isOnline = False
|
||||
self.daemon.decrementThreadCount('netCheck')
|
||||
|
||||
|
||||
def cleanOldBlocks(self):
|
||||
'''Delete old blocks if our disk allocation is full/near full'''
|
||||
while self.daemon._core._utils.storageCounter.isFull():
|
||||
oldest = self.daemon._core.getBlockList()[0]
|
||||
self.daemon._core._blacklist.addToDB(oldest)
|
||||
self.daemon._core.removeBlock(oldest)
|
||||
logger.info('Deleted block: %s' % (oldest,))
|
||||
logger.info('Deleted block: %s' % (oldest,))
|
||||
self.daemon.decrementThreadCount('cleanOldBlocks')
|
||||
|
||||
def cooldownPeer(self):
|
||||
|
@ -88,7 +88,7 @@ class DaemonTools:
|
|||
del self.daemon.cooldownPeer[peer]
|
||||
|
||||
# Cool down a peer, if we have max connections alive for long enough
|
||||
if onlinePeerAmount >= self.daemon._core.config.get('peers.maxConnect'):
|
||||
if onlinePeerAmount >= self.daemon._core.config.get('peers.max_connect', 10):
|
||||
finding = True
|
||||
while finding:
|
||||
try:
|
||||
|
@ -102,4 +102,4 @@ class DaemonTools:
|
|||
else:
|
||||
self.daemon.removeOnlinePeer(toCool)
|
||||
self.daemon.cooldownPeer[toCool] = self.daemon._core._utils.getEpoch()
|
||||
self.daemon.decrementThreadCount('cooldownPeer')
|
||||
self.daemon.decrementThreadCount('cooldownPeer')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue