Sex drive and guilt

Been with my wife almost 20 years. Always had good sex life. No E.D. issues.

I had an affair. She found out 9 months ago. We have been working through things since.

At first I didn’t have any E.D. issues. In the last few months I have little to no sex drive. Just not horny. Don’t masturbate or desire sex lately. Lost erection a couple times which didn’t help either.

My lack of sex drive is holding up healing our marriage. How do I get past this? I get night erections so the plumbing works.

How long will this last? How do I get past this?