check block POW *before* syncning from lan

master
Kevin Froman 2020-12-02 23:01:12 -06:00
parent dcc304be9d
commit 9db9c495c8
1 changed files with 2 additions and 1 deletions

View File

@ -12,6 +12,7 @@ from coredb.blockmetadb import get_block_list
from onionrblocks.blockimporter import import_block_from_data from onionrblocks.blockimporter import import_block_from_data
import onionrexceptions import onionrexceptions
from ..server import ports from ..server import ports
from onionrproofs import hashMeetsDifficulty
from threading import Thread from threading import Thread
""" """
@ -37,7 +38,7 @@ def _lan_work(peer: LANIP):
our_blocks = get_block_list() our_blocks = get_block_list()
blocks = requests.get(url + 'blist/0').text.splitlines() blocks = requests.get(url + 'blist/0').text.splitlines()
for block in blocks: for block in blocks:
if block not in our_blocks: if block not in our_blocks and hashMeetsDifficulty(block):
try: try:
import_block_from_data( import_block_from_data(
requests.get( requests.get(