From bb8881ac757432c2a8bbfb65afcad4c5fe36b141 Mon Sep 17 00:00:00 2001 From: Jason Carver Date: Thu, 7 Mar 2019 16:50:22 -0800 Subject: [PATCH] lint roll --- tests/core/utils/test_root_tracker.py | 1 - trinity/sync/common/headers.py | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/core/utils/test_root_tracker.py b/tests/core/utils/test_root_tracker.py index 9115367a3a..a11e825b17 100644 --- a/tests/core/utils/test_root_tracker.py +++ b/tests/core/utils/test_root_tracker.py @@ -114,7 +114,6 @@ def binary_parent(node): st.integers(min_value=0, max_value=6), min_size=3, )) -#@settings(max_examples=20000) def test_prune_reinsert_root_tracking_binary_tree(element_flipping): tracker = RootTracker() diff --git a/trinity/sync/common/headers.py b/trinity/sync/common/headers.py index 382069387c..698ea7896a 100644 --- a/trinity/sync/common/headers.py +++ b/trinity/sync/common/headers.py @@ -492,6 +492,17 @@ async def new_sync_headers( if False: yield + @abstractmethod + async def clear_buffer(self) -> None: + """ + Whatever headers have been received until now, dump them all and restart. + This is a last resort, to be used only when a consumer seems to receive + headers out of other and decides they have no other option besides reset. + + It wastes a lot of previously completed work. + """ + pass + @abstractmethod def get_target_header_hash(self) -> Hash32: pass