Masturbation during ihram (hajj) is treated like intercourse. Assuming you did so before reaching muzdalifah, you must pay kaffarah and repeat it. However, there is no restriction on marriage. The kaffarah is to sacrifice a camel or cow. You must try to determine when you committed the act, and it seems, if you did it repeatedly then determine with as much certainty when. The hajj must be repeated yourself