Remove check for blockchain synced (#621)

This commit is contained in:
Jonathan Zernik 2021-01-12 14:05:36 -08:00 committed by GitHub
parent 51b2df0d7d
commit ed16492a75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 28 deletions

View file

@ -297,9 +297,6 @@ class SqueakController:
def get_network(self):
return self.config.core.network
def is_blockchain_synced(self):
return self.squeak_core.is_blockchain_synced()
def get_offer(self, squeak: CSqueak, offer: Offer, peer: SqueakPeer) -> ReceivedOffer:
return self.squeak_core.unpack_offer(squeak, offer, peer)

View file

@ -292,12 +292,3 @@ class SqueakCore:
client_addr=sent_offer.client_addr,
)
yield received_payment
def is_blockchain_synced(self) -> bool:
"""Check if the blockchain is synced.
Returns:
bool: True if the blockchain is synced.
"""
get_info_response = self.lightning_client.get_info()
return get_info_response.synced_to_chain

View file

@ -16,25 +16,16 @@ class SqueakServerHandler(object):
self.squeak_controller = squeak_controller
def handle_posted_squeak(self, squeak: CSqueak):
if not self.squeak_controller.is_blockchain_synced():
raise Exception("Blockchain not synced.")
logger.info(
"Handle posted squeak with hash: {}".format(get_hash(squeak).hex()))
# Save the squeak
self.squeak_controller.save_uploaded_squeak(squeak)
def handle_get_squeak(self, squeak_hash: bytes):
if not self.squeak_controller.is_blockchain_synced():
raise Exception("Blockchain not synced.")
logger.info("Handle get squeak by hash: {}".format(squeak_hash.hex()))
return self.squeak_controller.get_public_squeak(squeak_hash)
def handle_lookup_squeaks(self, request):
if not self.squeak_controller.is_blockchain_synced():
raise Exception("Blockchain not synced.")
addresses = request.addresses
min_block = request.min_block
max_block = request.max_block
@ -58,9 +49,6 @@ class SqueakServerHandler(object):
)
def handle_get_offer(self, squeak_hash: bytes, client_addr: str):
if not self.squeak_controller.is_blockchain_synced():
raise Exception("Blockchain not synced.")
logger.info(
"Handle get offer by hash: {} from client_addr: {}".format(
squeak_hash.hex(), client_addr

View file

@ -14,10 +14,6 @@ class SqueakSyncController:
self.squeak_controller = squeak_controller
def sync_timeline(self):
if not self.squeak_controller.is_blockchain_synced():
logger.error(
"Failed to sync timeline because blockchain out of sync.")
return
try:
block_height = self.squeak_controller.get_best_block_height()
except Exception: