during subscribe, hash address only when its time

This commit is contained in:
Victor Shyba 2021-03-10 12:51:58 -03:00
parent 62fa85c0a4
commit 9ae30ac08e

View file

@ -1275,10 +1275,9 @@ class LBRYElectrumX(SessionBase):
address: the address to subscribe to"""
if len(addresses) > 1000:
raise RPCError(BAD_REQUEST, f'too many addresses in subscription request: {len(addresses)}')
hashXes = [
(self.address_to_hashX(address), address) for address in addresses
return [
await self.hashX_subscribe(self.address_to_hashX(address), address) for address in addresses
]
return [await self.hashX_subscribe(*args) for args in hashXes]
async def address_unsubscribe(self, address):
"""Unsubscribe an address.