def main():
cachePath = os.path.join(tempfile.gettempdir(), CACHEFILE)
cache = loadCache(cachePath, BASE64)
chainInfo = rpcRetrieve('getblockchaininfo')
bestHash = chainInfo['bestblockhash']
height = int(chainInfo['blocks'])
bip9forks = chainInfo['bip9_softforks']
print(formatWelcome(cache, WINDOW, bestHash, height,
F(chainInfo['difficulty']), bip9forks, THRESHOLD))
if cache.height == 0:
print('Please wait while retrieving latest block versions and caching them...\n')
if len(cache.hashes) < 1 or cache.hashes[0] != bestHash:
retrieveBlock = lambda h: rpcRetrieve('getblock', h)
cache = updateCache(cache, WINDOW, HASHES_SIZE, bestHash, height, retrieveBlock)
saveCache(cache, cachePath, BASE64)
print(formatAllData(cache, bip9forks, THRESHOLD, WINDOW))
评论列表
文章目录