Skip to content
Snippets Groups Projects
Unverified Commit 5c853272 authored by Benjamin Loison's avatar Benjamin Loison
Browse files

Use `int(cli([getblockcount])` instead of `cli_json([getblockchaininfo])[headers]`

parent cf229090
No related merge requests found
......@@ -27,7 +27,7 @@ def loadHeaders(break_at):
global headers
print('Loading headers...')
if not LOAD_FROM_HEADERS_FILE:
headersNumber = break_at if break_at else cli_json(['getblockchaininfo'])['headers']
headersNumber = break_at if break_at else int(cli(['getblockcount']))
headerHashes = pull('getblockhash', list(range(headersNumber)), 2)
headers = pull('getblockheader', headerHashes, 3)
else:
......
  • Owner

    Note that on a not blocks synchronized node:

    • int(cli(['getblockcount'])) returns the number of synchronized blocks
    • cli_json(['getblockchaininfo'])['headers'] returns the number of synchronized headers
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment