Destination sharing tweaks

This commit is contained in:
TheKysek 2017-07-03 09:23:02 +02:00
parent 1d4d92c931
commit 974568164f
No known key found for this signature in database
GPG Key ID: 50D9AF00D0B1C497
3 changed files with 3 additions and 2 deletions

View File

@ -294,7 +294,7 @@ class Connection(threading.Thread):
if obj.is_valid() and obj.vector not in shared.objects:
with shared.objects_lock:
shared.objects[obj.vector] = obj
if obj.object_type == shared.i2p_dest_obj_type:
if obj.object_type == shared.i2p_dest_obj_type and obj.version == shared.i2p_dest_obj_version:
dest = base64.b64encode(obj.object_payload, altchars=b'-~')
logging.debug('Received I2P destination object, adding to i2p_unchecked_node_pool')
logging.debug(dest)

View File

@ -162,5 +162,5 @@ class Manager(threading.Thread):
if shared.i2p_session_nick:
logging.info('Publishing our I2P destination')
dest_pub_raw = base64.b64decode(shared.i2p_dest_pub, altchars=b'-~')
obj = structure.Object(b'\x00' * 8, int(time.time() + 2 * 3600), 0x493250, 1, 1, dest_pub_raw)
obj = structure.Object(b'\x00' * 8, int(time.time() + 2 * 3600), shared.i2p_dest_obj_type, shared.i2p_dest_obj_version, 1, dest_pub_raw)
pow.do_pow_and_publish(obj)

View File

@ -24,6 +24,7 @@ user_agent = b'/MiNode:0.2.2/'
timeout = 600
header_length = 24
i2p_dest_obj_type = 0x493250
i2p_dest_obj_version = 1
i2p_enabled = False
i2p_sam_host = '127.0.0.1'