work on torgossip

This commit is contained in:
Kevin Froman 2021-02-04 05:21:37 +00:00
parent 9d546432f5
commit b4127c9836
2 changed files with 10 additions and 4 deletions

View File

@ -65,11 +65,12 @@ def torgossip_runtest(test_manager):
s.sendall(b'5' + bl_new.id)
assert s.recv(64) == bl_new.get_packed()
s.sendall(b'41tst')
assert s.recv(1000) == tsts[64:]
s.sendall(b'40,tbt')
assert len(s.recv(100000)) == len(shared_state.get_by_string("SafeDB").get('bl-tbt'))
s.sendall(b'42tst')
assert s.recv(1000) == tsts[64*2:]
s.sendall(b'41,tbt')
assert len(s.recv(100000)) == len(
shared_state.get_by_string("SafeDB").get('bl-tbt')) - 64
# test peer list
#fake_peer = _fake_onion()

View File

@ -73,6 +73,11 @@ def start_server(shared_state):
conn.sendall(
commandhandlers.list_blocks_by_type(
shared_state.get_by_string('SafeDB'), data))
elif cmd == GossipCommands.LIST_BLOCKS_BY_TYPE_OFFSET:
conn.sendall(
commandhandlers.list_blocks_by_type_and_offset(
shared_state.get_by_string('SafeDB'), data)
)
elif cmd == GossipCommands.CHECK_HAS_BLOCK:
conn.sendall(
commandhandlers.handle_check_block(