Prune any hashes not in source resource or change list.

def prune_hashes(self, hashes, list_type):
        """Prune any hashes not in source resource or change list."""
        discarded = []
        for hash in hashes:
            if (hash in self.hashes):
                self.hashes.discard(hash)
                discarded.append(hash)
        self.logger.info("Not calculating %s hash(es) on destination as not present "
                         "in source %s list" % (', '.join(sorted(discarded)), list_type))