work on torgossip
This commit is contained in:
parent
9d546432f5
commit
b4127c9836
@ -65,11 +65,12 @@ def torgossip_runtest(test_manager):
|
|||||||
s.sendall(b'5' + bl_new.id)
|
s.sendall(b'5' + bl_new.id)
|
||||||
assert s.recv(64) == bl_new.get_packed()
|
assert s.recv(64) == bl_new.get_packed()
|
||||||
|
|
||||||
s.sendall(b'41tst')
|
s.sendall(b'40,tbt')
|
||||||
assert s.recv(1000) == tsts[64:]
|
assert len(s.recv(100000)) == len(shared_state.get_by_string("SafeDB").get('bl-tbt'))
|
||||||
|
|
||||||
s.sendall(b'42tst')
|
s.sendall(b'41,tbt')
|
||||||
assert s.recv(1000) == tsts[64*2:]
|
assert len(s.recv(100000)) == len(
|
||||||
|
shared_state.get_by_string("SafeDB").get('bl-tbt')) - 64
|
||||||
|
|
||||||
# test peer list
|
# test peer list
|
||||||
#fake_peer = _fake_onion()
|
#fake_peer = _fake_onion()
|
||||||
|
@ -73,6 +73,11 @@ def start_server(shared_state):
|
|||||||
conn.sendall(
|
conn.sendall(
|
||||||
commandhandlers.list_blocks_by_type(
|
commandhandlers.list_blocks_by_type(
|
||||||
shared_state.get_by_string('SafeDB'), data))
|
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:
|
elif cmd == GossipCommands.CHECK_HAS_BLOCK:
|
||||||
conn.sendall(
|
conn.sendall(
|
||||||
commandhandlers.handle_check_block(
|
commandhandlers.handle_check_block(
|
||||||
|
Loading…
Reference in New Issue
Block a user