def METHOD_NAME(self, locator, hash_stop, current_tip=None):
    if current_tip is None:
        current_tip = self.currentBlock
    current_block = self.get(current_tip)
    if current_block is None:
        return None
    response = msg_headers()
    headersList = [ CBlockHeader(current_block) ]
    maxheaders = 2000
    while (headersList[0].sha256 not in locator.vHave):
        prevBlockHash = headersList[0].hashPrevBlock
        prevBlock = self.get(prevBlockHash)
        if prevBlock is not None:
            headersList.insert(0, CBlockHeader(prevBlock))
        else:
            break
    headersList = headersList[:maxheaders] # truncate if we have too many
    hashList = [x.sha256 for x in headersList]
    index = len(headersList)
    if (hash_stop in hashList):
        index = hashList.index(hash_stop)+1
    response.headers = headersList[:index]
    return response