From 25485e6aa4cc74cd2fc2d0849ba7515e3db5b279 Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 29 Jun 2020 02:29:55 -0500 Subject: [PATCH] * Revert back to hiding blocks even when we have no outgoing connections * ensure that block is hidden in public list in insert test --- src/communicator/daemoneventhooks/__init__.py | 2 -- src/runtests/inserttest.py | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/communicator/daemoneventhooks/__init__.py b/src/communicator/daemoneventhooks/__init__.py index f018c276..f7bec957 100644 --- a/src/communicator/daemoneventhooks/__init__.py +++ b/src/communicator/daemoneventhooks/__init__.py @@ -57,8 +57,6 @@ def daemon_event_handlers(shared_state: 'TooMany'): def upload_event(block: 'BlockHash' = ''): if not block: raise ValueError - if not comm_inst.onlinePeers: - return public_api.hideBlocks.append(block) try: mixmate.block_mixer(comm_inst.blocksToUpload, block) diff --git a/src/runtests/inserttest.py b/src/runtests/inserttest.py index 63b3a57f..ea43fd44 100644 --- a/src/runtests/inserttest.py +++ b/src/runtests/inserttest.py @@ -12,7 +12,10 @@ def _check_remote_node(testmanager): def insert_bin_test(testmanager): data = os.urandom(32) b_hash = onionrblocks.insert(data) + time.sleep(0.3) + if b_hash not in testmanager._too_many.get_by_string("PublicAPI").hideBlocks: + raise ValueError("Block not hidden") - if not b_hash in coredb.blockmetadb.get_block_list(): + if b_hash not in coredb.blockmetadb.get_block_list(): logger.error(str(b_hash) + 'is not in bl') raise ValueError