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()
if code_b64 in whitelisted_source:
return
# uncomment when you want to build on the whitelist
#else:
# with open("../static-data/base64-code-whitelist.txt", "a") as f:
# f.write(code_b64 + "\n")
# return
#uncomment when you want to build on the whitelist
else:
with open("../static-data/base64-code-whitelist.txt", "a") as f:
f.write(code_b64 + "\n")
return
for source in whitelisted_code:
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):
block_db = shared_state.get_by_string('SafeDB')
peer_db = shared_state.get_by_string('TorGossipPeers')
while True:
if not 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
SERVER_SOCKET = identify_home() + "torgossip.sock"
HOSTNAME_FILE = identify_home() + "torgossip-hostname"
GOSSIP_PORT = 2020
home = identify_home()
SERVER_SOCKET = home + "torgossip.sock"
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
}