Browse Source

network: rm dead code; simplify

3.3.3.1
SomberNight 6 years ago
parent
commit
8cd08cc0fa
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 1
      electrum/blockchain.py
  2. 17
      electrum/network.py

1
electrum/blockchain.py

@ -99,7 +99,6 @@ class Blockchain(util.PrintError):
def __init__(self, config, forkpoint, parent_id):
self.config = config
self.catch_up = None # interface catching up
self.forkpoint = forkpoint
self.checkpoints = constants.net.CHECKPOINTS
self.parent_id = parent_id

17
electrum/network.py

@ -198,13 +198,9 @@ class Network(PrintError):
self.bhi_lock = asyncio.Lock()
self.interface_lock = threading.RLock() # <- re-entrant
self.callback_lock = threading.Lock()
self.pending_sends_lock = threading.Lock()
self.recent_servers_lock = threading.RLock() # <- re-entrant
self.blockchains_lock = threading.Lock()
self.pending_sends = []
self.message_id = 0
self.debug = False
self.irc_servers = {} # returned by interface (list from irc)
self.recent_servers = self.read_recent_servers() # note: needs self.recent_servers_lock
@ -217,10 +213,6 @@ class Network(PrintError):
dir_path = os.path.join(self.config.path, 'certs')
util.make_dir(dir_path)
# subscriptions and requests
self.h2addr = {}
# Requests from client we've not seen a response to
self.unanswered_requests = {}
# retry times
self.server_retry_time = time.time()
self.nodes_retry_time = time.time()
@ -608,10 +600,6 @@ class Network(PrintError):
if server in self.interfaces:
self.close_interface(self.interfaces[server])
self.notify('interfaces')
with self.blockchains_lock:
for b in blockchain.blockchains.values():
if b.catch_up == server:
b.catch_up = None
@aiosafe
async def new_interface(self, server):
@ -799,9 +787,6 @@ class Network(PrintError):
self.switch_to_interface(self.default_server)
else:
if self.config.is_fee_estimates_update_required():
await self.interface.group.spawn(self.attempt_fee_estimate_update())
await self.interface.group.spawn(self.request_fee_estimates(self.interface))
await asyncio.sleep(0.1)
async def attempt_fee_estimate_update(self):
await self.request_fee_estimates(self.interface)

Loading…
Cancel
Save