When a right or estate of dower or curtesy is sold pursuant to section 3A:16-16 of this title, the court shall direct payment of such sum in gross out of the proceeds of the sale of the real estate to the person entitled to such right or estate, as shall be deemed a just and reasonable satisfaction therefor, and which the person so entitled shall consent in writing to accept in lieu thereof. If no such consent is given, the court shall ascertain and determine what proportion of the proceeds will be a just and reasonable sum to be invested for the benefit of the person entitled to such right or estate, and shall direct that such sum be invested under direction and control of the court for the benefit of the parties entitled, and that the income thereon be paid to them as it becomes due as a compensation for, and in lieu of the right or estate of dower or curtesy, and that at the death of the person entitled to the income the principal sum be paid to or distributed among the parties entitled thereto.
N.J.S. § 3A:16-17