i dont know what to do.

So my husband recently told me the he had a pill addiction. After a year of me asking him if he had one. His friend of many years has had many drug addictions and I was afraid of him getting into that because he started hanging out with him more than usual. I asked him over the years if he had a problem because I noticed money started going missing and he was out a lot more with his friend and his mood was very different. He told me when he was younger he got into coke with his friend and once he realized it was a problem he stopped. But I honestly don't believe he stopped because some of his other friends had told me he's done a line or two with them on more than one occasion. When I asked him about it he told me that he did and it was no big deal. Well after our daughter was born I noticed a big change. He was home more and rarely talked to his drug addicted friend and all was great! Until he got a new job with his friend last year and I noticed the changes. He always denied doing anything and told me I was being paranoid. So I put it aside and tried to work on our marriage. A few months later we found out we were expecting our second child and sadly that we were being evicted out of our home. So he moved in with his mother and I moved in with mine. At first it was rough, we argued everyday about who got our daughter, who got what. It was horrible. It got to the point where he filed for full custody of our daughter and was willing to take me to court. But thankfully he never went through with it. Well a month passed and we finally got on good terms and came up with an agreement. We were doing fine and then his friend came back and became very aggressive towards my husband. Pretty much harassment. I mean calls, text, threats about beating my husband up for what ever reason etc. it got to the point where i wanted my husband to call the cops on him and get a restraining order on him. But my husband always made an excuse for him and told me he's just coming off of drugs and this is how he withdraws. It got to a point where I was afraid my husband was having an affair with him. Because the way he was acting it was like he was in love with my husband and he broke his heart! Finally after telling my husband he needs to do something or else I will, he dropped the bomb on me. That he was addicted to pain killers and that his friend was his supplier. He was mad because my husband went to get help and that he was supposed to help him get help by giving him his pills that help kick addiction. He wasn't allowed back to the rehab facility because he's been there so many times they refused to help him again. I asked why he didn't tell me sooner and he had the nerve to tell me that he didn't want me to have something to use against him to take our daughter away from him. And he was afraid his friend was going to tell me about his addiction. Also I should be happy he's getting help. I'm happy he is getting the help he needs it's just I feel so stupid. And that he has no problem trying to take our daughter away from me but was afraid I would! I believed him when he told me no he didn't have a problem and I fought for him when other people such as friends and family told me they were worried he was doing drugs again. I defended his name and got into many arguments about his drug abuse problems only for them to be right! And the fact he told me I shouldn't get mad made me hurt even more. I mean how can I not be mad!!! He lied to me and I feel like this was a big deal! I dont know what to do. I feel like if he's lied about this what else could he be lying about? I just feel so hurt and have no one to talk to because I don't want to hear 'I told you so' or 'I knew it, leave him'. We all have our problems but I feel like he leaves one thing and goes to another and since it's not consistent he doesn't have a problem when in actuality he does. I really want it go to marriage counseling and I really feel like we need help but knowing him he's not going to want to go. I just don't know what to do anymore. Should I stay? Should I leave? Sorry so long I just needed to vent.