work on torgossip

This commit is contained in:
Kevin Froman 2021-02-08 07:32:31 +00:00
parent 8a6129f4e2
commit d9c0adcc7b
5 changed files with 26 additions and 9 deletions

View File

@ -76,11 +76,11 @@ def block_exec(event, info):
code_b64 = base64.b64encode(info[0].co_code).decode() code_b64 = base64.b64encode(info[0].co_code).decode()
if code_b64 in whitelisted_source: if code_b64 in whitelisted_source:
return return
# uncomment when you want to build on the whitelist #uncomment when you want to build on the whitelist
#else: else:
# with open("../static-data/base64-code-whitelist.txt", "a") as f: with open("../static-data/base64-code-whitelist.txt", "a") as f:
# f.write(code_b64 + "\n") f.write(code_b64 + "\n")
# return return
for source in whitelisted_code: for source in whitelisted_code:
if info[0].co_filename.endswith(source): if info[0].co_filename.endswith(source):

View File

@ -77,10 +77,14 @@ def _client_pool(shared_state, socket_pool: dict):
def client_loop(shared_state, socket_pool): def client_loop(shared_state, socket_pool):
block_db = shared_state.get_by_string('SafeDB')
peer_db = shared_state.get_by_string('TorGossipPeers')
while True: while True:
if not socket_pool: if not socket_pool:
_client_pool(shared_state, socket_pool) _client_pool(shared_state, socket_pool)
sync_

View File

@ -0,0 +1,7 @@
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from socket import socket
def download_blocks(sock: 'socket', offset: int):
sock.sendall()

View File

@ -1,4 +1,6 @@
from utils.identifyhome import identify_home from utils.identifyhome import identify_home
SERVER_SOCKET = identify_home() + "torgossip.sock" home = identify_home()
HOSTNAME_FILE = identify_home() + "torgossip-hostname" SERVER_SOCKET = home + "torgossip.sock"
GOSSIP_PORT = 2020 HOSTNAME_FILE = home + "torgossip-hostname"
CONFIG_FILE = home + "torgossip_config.json"
GOSSIP_PORT = 2021

View File

@ -0,0 +1,4 @@
{
"fanout": 4,
"run_server": true
}