From fd04c607b27ca68d74fac2a72e8452cfc9a2f7df Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 7 May 2018 13:11:31 -0300 Subject: [PATCH] typos and fixes from code review --- lbrynet/core/Wallet.py | 4 +++- lbrynet/tests/mocks.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lbrynet/core/Wallet.py b/lbrynet/core/Wallet.py index 64a3223c6..577e6e3d4 100644 --- a/lbrynet/core/Wallet.py +++ b/lbrynet/core/Wallet.py @@ -98,8 +98,10 @@ class Wallet(object): response = yield treq.get(HEADERS_URL, headers=resume_header) got_406 = response.code == 406 # our file is bigger final_size_after_download = response.length + local_header_size + if got_406: + log.warning("s3 is more out of date than we are") # should have something to download and a final length divisible by the header size - if not got_406 and final_size_after_download and not final_size_after_download % HEADER_SIZE: + elif final_size_after_download and not final_size_after_download % HEADER_SIZE: s3_height = (final_size_after_download / HEADER_SIZE) - 1 local_height = self.local_header_file_height() if s3_height > local_height: diff --git a/lbrynet/tests/mocks.py b/lbrynet/tests/mocks.py index 25ac42e80..12770c188 100644 --- a/lbrynet/tests/mocks.py +++ b/lbrynet/tests/mocks.py @@ -18,7 +18,7 @@ from lbrynet import conf from util import debug_kademlia_packet KB = 2**10 -PUBLIC_EXPOENT = 65537 # http://www.daemonology.net/blog/2009-06-11-cryptographic-right-answers.html +PUBLIC_EXPONENT = 65537 # http://www.daemonology.net/blog/2009-06-11-cryptographic-right-answers.html def decode_rsa_key(pem_key): @@ -162,7 +162,7 @@ class PointTraderKeyQueryHandler(object): class Wallet(object): def __init__(self): - self.private_key = rsa.generate_private_key(public_exponent=PUBLIC_EXPOENT, + self.private_key = rsa.generate_private_key(public_exponent=PUBLIC_EXPONENT, key_size=1024, backend=default_backend()) self.encoded_public_key = self.private_key.public_key().public_bytes(serialization.Encoding.PEM, serialization.PublicFormat.PKCS1)