From 9db9c495c88fdc3ac7873298cc779d22275eb782 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Wed, 2 Dec 2020 23:01:12 -0600 Subject: [PATCH] check block POW *before* syncning from lan --- src/lan/client/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lan/client/__init__.py b/src/lan/client/__init__.py index b2626b63..6b1dab66 100644 --- a/src/lan/client/__init__.py +++ b/src/lan/client/__init__.py @@ -12,6 +12,7 @@ from coredb.blockmetadb import get_block_list from onionrblocks.blockimporter import import_block_from_data import onionrexceptions from ..server import ports +from onionrproofs import hashMeetsDifficulty from threading import Thread """ @@ -37,7 +38,7 @@ def _lan_work(peer: LANIP): our_blocks = get_block_list() blocks = requests.get(url + 'blist/0').text.splitlines() for block in blocks: - if block not in our_blocks: + if block not in our_blocks and hashMeetsDifficulty(block): try: import_block_from_data( requests.get(