From dac28bf5822d5ee1ed02f79e6f735ba3f4b448e3 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 1 Dec 2016 14:16:19 +0100 Subject: Remove spurious message length checks. No only are they spurious but even harmful, by hiding errors. --- tools/merge_fetch.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tools/merge_fetch.py b/tools/merge_fetch.py index d6c8cb3..5fdb7d0 100755 --- a/tools/merge_fetch.py +++ b/tools/merge_fetch.py @@ -120,11 +120,7 @@ def merge_fetch_worker(args, localconfig, storagenode, pipe): while True: ## Read all messages from parent. while pipe.poll(): - msg = pipe.recv() - if len(msg) < 2: - continue - cmd = msg[0] - ehash = msg[1] + cmd, ehash = pipe.recv() if cmd == 'FETCH': to_fetch.add(ehash) @@ -205,8 +201,6 @@ def merge_fetch_parallel(args, config, localconfig): logging.info("polling %s", name) while pipe.poll(): msg = pipe.recv() - if len(msg) < 2: - continue cmd = msg[0] ehash = msg[1] if cmd == 'NEWENTRY': @@ -214,8 +208,6 @@ def merge_fetch_parallel(args, config, localconfig): if not ehash in fetch_dict: # Don't fetch twice. fetch_set.add(ehash) elif cmd == 'FETCHED': - if len(msg) != 3: - continue entry = msg[2] logging.info("FETCHED from %s: %s", name, hexencode(ehash)) chainsdb.add(ehash, entry) -- cgit v1.1