that is what line 39 does. it checks that there are no IPNs present for that id in its queue.