getCurrentTxnId() is basically doing this. It gives you the latest spHandle recorded by m_txnEgo. You shouldn't have to track the latest spHandle separately. Did you see the spHandle going backward? What was causing it to go backward? Maybe the problem is elsewhere.