mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-30 17:01:34 +00:00
Subscribed address fix
Add an addr to the subcribed address set on receiving a response, not on sending a request.
This commit is contained in:
parent
cbf9052dae
commit
3746050fe6
1 changed files with 4 additions and 4 deletions
|
@ -509,6 +509,10 @@ class Network(util.DaemonThread):
|
||||||
# Copy the request method and params to the response
|
# Copy the request method and params to the response
|
||||||
response['method'] = method
|
response['method'] = method
|
||||||
response['params'] = params
|
response['params'] = params
|
||||||
|
# Only once we've received a response to an addr subscription
|
||||||
|
# add it to the list; avoids double-sends on reconnection
|
||||||
|
if method == 'blockchain.address.subscribe':
|
||||||
|
self.subscribed_addresses.add(params[0])
|
||||||
else:
|
else:
|
||||||
if not response: # Closed remotely / misbehaving
|
if not response: # Closed remotely / misbehaving
|
||||||
self.connection_down(interface.server)
|
self.connection_down(interface.server)
|
||||||
|
@ -570,10 +574,6 @@ class Network(util.DaemonThread):
|
||||||
callback(out)
|
callback(out)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if method == 'blockchain.address.subscribe':
|
|
||||||
addr = params[0]
|
|
||||||
self.subscribed_addresses.add(addr)
|
|
||||||
|
|
||||||
# This request needs connectivity. If we don't have an
|
# This request needs connectivity. If we don't have an
|
||||||
# interface, we cannot process it.
|
# interface, we cannot process it.
|
||||||
if not self.interface:
|
if not self.interface:
|
||||||
|
|
Loading…
Add table
Reference in a new issue