The longest chain is selected. If they are equal, then the hash
        value of the previous block id and publisher signature is computed.
        The lowest result value is the winning block.
        Args:
            cur_fork_head: The current head of the block chain.
            new_fork_head: The head of the fork that is being evaluated.
        Returns:
            bool: True if choosing the new chain head, False if choosing
            the current chain head.

def compare_forks(self, cur_fork_head, new_fork_head):
        """The longest chain is selected. If they are equal, then the hash
        value of the previous block id and publisher signature is computed.
        The lowest result value is the winning block.
        Args:
            cur_fork_head: The current head of the block chain.
            new_fork_head: The head of the fork that is being evaluated.
        Returns:
            bool: True if choosing the new chain head, False if choosing
            the current chain head.
        """

        # If the new fork head is not DevMode consensus, bail out.  This should
        # never happen, but we need to protect against it.
        if new_fork_head.consensus != b"Devmode":
            raise \
                TypeError(
                    'New fork head {} is not a DevMode block'.format(
                        new_fork_head.identifier[:8]))

        # If the current fork head is not DevMode consensus, check the new fork
        # head to see if its immediate predecessor is the current fork head. If
        # so that means that consensus mode is changing.  If not, we are again
        # in a situation that should never happen, but we need to guard
        # against.
        if cur_fork_head.consensus != b"Devmode":
            if new_fork_head.previous_block_id == cur_fork_head.identifier:
                LOGGER.info(
                    'Choose new fork %s: New fork head switches consensus to '
                    'DevMode',
                    new_fork_head.identifier[:8])
                return True

            raise \
                TypeError(
                    'Trying to compare a DevMode block {} to a non-DevMode '
                    'block {} that is not the direct predecessor'.format(
                        new_fork_head.identifier[:8],
                        cur_fork_head.identifier[:8]))

        if new_fork_head.block_num == cur_fork_head.block_num:
            cur_fork_hash = self.hash_signer_public_key(
                cur_fork_head.header.signer_public_key,
                cur_fork_head.header.previous_block_id)
            new_fork_hash = self.hash_signer_public_key(
                new_fork_head.header.signer_public_key,
                new_fork_head.header.previous_block_id)

            result = new_fork_hash < cur_fork_hash

        else:
            result = new_fork_head.block_num > cur_fork_head.block_num

        return result