use buffer write return as written
This commit is contained in:
parent
a20e2504bb
commit
a20088330f
1 changed files with 2 additions and 3 deletions
|
@ -321,11 +321,10 @@ class BaseLedger(metaclass=LedgerRegistry):
|
||||||
async with self.headers.checkpointed_connector() as buffer:
|
async with self.headers.checkpointed_connector() as buffer:
|
||||||
for chunk in chunks:
|
for chunk in chunks:
|
||||||
headers = await chunk
|
headers = await chunk
|
||||||
total += len(headers['base64'])
|
total += buffer.write(
|
||||||
buffer.write(
|
|
||||||
zlib.decompress(base64.b64decode(headers['base64']), wbits=-15, bufsize=600_000)
|
zlib.decompress(base64.b64decode(headers['base64']), wbits=-15, bufsize=600_000)
|
||||||
)
|
)
|
||||||
self._download_height = current + buffer.tell() // self.headers.header_size
|
self._download_height = current + total // self.headers.header_size
|
||||||
log.info("Headers sync: %s / %s", self._download_height, target)
|
log.info("Headers sync: %s / %s", self._download_height, target)
|
||||||
|
|
||||||
async def update_headers(self, height=None, headers=None, subscription_update=False):
|
async def update_headers(self, height=None, headers=None, subscription_update=False):
|
||||||
|
|
Loading…
Reference in a new issue