mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-17 13:07:32 +02:00
Remove check for blockchain synced (#621)
This commit is contained in:
parent
51b2df0d7d
commit
ed16492a75
4 changed files with 0 additions and 28 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue