mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-21 02:19:51 +00:00
fix #2533
This commit is contained in:
parent
eff0ae1f78
commit
a7679debd1
1 changed files with 7 additions and 4 deletions
|
@ -777,14 +777,17 @@ class Network(util.DaemonThread):
|
||||||
|
|
||||||
def on_get_chunk(self, interface, response):
|
def on_get_chunk(self, interface, response):
|
||||||
'''Handle receiving a chunk of block headers'''
|
'''Handle receiving a chunk of block headers'''
|
||||||
if response.get('error'):
|
error = response.get('error')
|
||||||
interface.print_error(response.get('error'))
|
result = response.get('result')
|
||||||
|
params = response.get('params')
|
||||||
|
if result is None or params is None or error is not None:
|
||||||
|
interface.print_error(error or 'bad response')
|
||||||
return
|
return
|
||||||
# Ignore unsolicited chunks
|
# Ignore unsolicited chunks
|
||||||
index = response['params'][0]
|
index = params[0]
|
||||||
if interface.request != index:
|
if interface.request != index:
|
||||||
return
|
return
|
||||||
connect = interface.blockchain.connect_chunk(index, response['result'])
|
connect = interface.blockchain.connect_chunk(index, result)
|
||||||
# If not finished, get the next chunk
|
# If not finished, get the next chunk
|
||||||
if not connect:
|
if not connect:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Reference in a new issue