fix 'timed out subscribing to addresses' logging error

This commit is contained in:
Jack Robison 2020-05-26 11:49:45 -04:00
parent b66281eabc
commit adbbb11dbf
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -285,12 +285,13 @@ class Network:
async def subscribe_address(self, address, *addresses): async def subscribe_address(self, address, *addresses):
addresses = list((address, ) + addresses) addresses = list((address, ) + addresses)
server_addr_and_port = self.client.server_address_and_port # on disconnect client will be None
try: try:
return await self.rpc('blockchain.address.subscribe', addresses, True) return await self.rpc('blockchain.address.subscribe', addresses, True)
except asyncio.TimeoutError: except asyncio.TimeoutError:
log.warning( log.warning(
"timed out subscribing to addresses from %s:%i", "timed out subscribing to addresses from %s:%i",
*self.client.server_address_and_port *server_addr_and_port
) )
# abort and cancel, we can't lose a subscription, it will happen again on reconnect # abort and cancel, we can't lose a subscription, it will happen again on reconnect
if self.client: if self.client: