SomberNight
4 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
2 additions and
1 deletions
-
electrum/synchronizer.py
|
@ -93,10 +93,11 @@ class SynchronizerBase(NetworkJobOnDefaultServer): |
|
|
asyncio.run_coroutine_threadsafe(self._add_address(addr), self.asyncio_loop) |
|
|
asyncio.run_coroutine_threadsafe(self._add_address(addr), self.asyncio_loop) |
|
|
|
|
|
|
|
|
async def _add_address(self, addr: str): |
|
|
async def _add_address(self, addr: str): |
|
|
|
|
|
# note: this method is async as add_queue.put_nowait is not thread-safe. |
|
|
if not is_address(addr): raise ValueError(f"invalid bitcoin address {addr}") |
|
|
if not is_address(addr): raise ValueError(f"invalid bitcoin address {addr}") |
|
|
if addr in self.requested_addrs: return |
|
|
if addr in self.requested_addrs: return |
|
|
self.requested_addrs.add(addr) |
|
|
self.requested_addrs.add(addr) |
|
|
await self.add_queue.put(addr) |
|
|
self.add_queue.put_nowait(addr) |
|
|
|
|
|
|
|
|
async def _on_address_status(self, addr, status): |
|
|
async def _on_address_status(self, addr, status): |
|
|
"""Handle the change of the status of an address.""" |
|
|
"""Handle the change of the status of an address.""" |
|
|