disable pool for mixing and announce node sooner after start
This commit is contained in:
parent
c7bbd054e4
commit
3aeb305994
@ -213,7 +213,7 @@ class OnionrCommunicatorDaemon:
|
|||||||
self,
|
self,
|
||||||
announcenode.announce_node,
|
announcenode.announce_node,
|
||||||
3600, my_args=[self], requires_peer=True, max_threads=1)
|
3600, my_args=[self], requires_peer=True, max_threads=1)
|
||||||
announceTimer.count = (announceTimer.frequency - 120)
|
announceTimer.count = (announceTimer.frequency - 60)
|
||||||
else:
|
else:
|
||||||
logger.debug('Will not announce node.')
|
logger.debug('Will not announce node.')
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ class OnionrCommunicatorDaemon:
|
|||||||
|
|
||||||
shared_state.add(self)
|
shared_state.add(self)
|
||||||
|
|
||||||
if config.get('general.use_bootstrap', True):
|
if config.get('general.use_bootstrap_list', True):
|
||||||
bootstrappeers.add_bootstrap_list_to_peer_list(
|
bootstrappeers.add_bootstrap_list_to_peer_list(
|
||||||
self, [], db_only=True)
|
self, [], db_only=True)
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ def upload_blocks_from_communicator(comm_inst: 'OnionrCommunicatorDaemon'):
|
|||||||
session.fail_peer(peer)
|
session.fail_peer(peer)
|
||||||
comm_inst.getPeerProfileInstance(peer).addScore(-5)
|
comm_inst.getPeerProfileInstance(peer).addScore(-5)
|
||||||
logger.warn(
|
logger.warn(
|
||||||
f'Failed to upload {bl[:8]}, reason: {resp[:15]}',
|
f'Failed to upload {bl[:8]}, reason: {resp}',
|
||||||
terminal=True)
|
terminal=True)
|
||||||
else:
|
else:
|
||||||
session.fail()
|
session.fail()
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""Onionr - Private P2P Communication.
|
"""Onionr - Private P2P Communication.
|
||||||
|
|
||||||
Delay block uploads, optionally mixing them together
|
Perform block mixing
|
||||||
"""
|
"""
|
||||||
import time
|
import time
|
||||||
from typing import List
|
from typing import List
|
||||||
@ -41,12 +41,5 @@ def block_mixer(upload_list: List[onionrtypes.BlockHash],
|
|||||||
|
|
||||||
if time.time() - bl.claimedTime > onionrvalues.BLOCK_POOL_MAX_AGE:
|
if time.time() - bl.claimedTime > onionrvalues.BLOCK_POOL_MAX_AGE:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
if block_to_mix:
|
||||||
try:
|
upload_list.append(block_to_mix)
|
||||||
# add the new block to pool
|
|
||||||
upload_pool.add_to_pool(block_to_mix)
|
|
||||||
except PoolFullException:
|
|
||||||
# If the pool is full, move into upload queue
|
|
||||||
upload_list.extend(upload_pool.get_pool())
|
|
||||||
# then finally begin new pool with new block
|
|
||||||
upload_pool.add_to_pool(block_to_mix)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user