In this loop, there are two rows, (waiting is boolean - whether the txn is waiting on a lock).
Below, though, there is a loop for one row.
I had troubles when I did not include it, which I did not attempt to track down further.