Fix corner case in tracking spent tx.