code: def _parse_pool_transaction_file(
              ledger, nodeReg, cliNodeReg, nodeKeys, activeValidators,
              ledger_size=None):
          
          for _, txn in ledger.getAllTxn(to=ledger_size):
              if get_type(txn) == NODE:
                  txn_data = get_payload_data(txn)
                  nodeName = txn_data[DATA][ALIAS]
                  clientStackName = nodeName + CLIENT_STACK_SUFFIX
                  nHa = (txn_data[DATA][NODE_IP], txn_data[DATA][NODE_PORT]) \
                      if (NODE_IP in txn_data[DATA] and NODE_PORT in txn_data[DATA]) \
                      else None
                  cHa = (txn_data[DATA][CLIENT_IP], txn_data[DATA][CLIENT_PORT]) \
                      if (CLIENT_IP in txn_data[DATA] and CLIENT_PORT in txn_data[DATA]) \
                      else None
                  if nHa:
                      nodeReg[nodeName] = HA(*nHa)
                  if cHa:
                      cliNodeReg[clientStackName] = HA(*cHa)
  
                  try:
                      # TODO: Need to handle abbreviated verkey
                      key_type = 'verkey'
                      verkey = cryptonymToHex(str(txn_data[TARGET_NYM]))
                      key_type = 'identifier'
                      cryptonymToHex(get_from(txn))
                  except ValueError:
                      logger.exception(
                          'Invalid {}. Rebuild pool transactions.'.format(key_type))
                      exit('Invalid {}. Rebuild pool transactions.'.format(key_type))
  
                  nodeKeys[nodeName] = verkey
  
                  services = txn_data[DATA].get(SERVICES)
                  if isinstance(services, list):
                      if VALIDATOR in services:
                          activeValidators.add(nodeName)
                      else:
                          activeValidators.discard(nodeName)
docs: helper function for parseLedgerForHaAndKeys