(/me looks more closely at the code)

I was trying to avoid the secondary xpath lookup...
Why not pass `op` to `get_failcount_full()` via `check_operation_expiry()` ?  That way you'd already have the relevant operation.