1Drain the juice from the can of pineapples into a small saucepan; set aside.
2In a medium bowl, stir together the remaining crushed pineapple and the miniature marshmallows. Cover and refrigerate overnight.
3In the small saucepan with the pineapple juice, add the sugar, flour, vinegar and egg, and whisk together. Place the pan over medium heat and cook, stirring constantly with a rubber spatula, until the mixture thickens and reaches 170°F on an instant-read thermometer. Strain the mixture through a fine-mesh sieve into a large bowl. - Let cool to room temperature, then cover and refrigerate overnight.
4The next day, add the pineapple and marshmallow mixture to the custard, then stir in the chopped apples and peanuts. With a rubber spatula, fold in the Cool Whip until completely combined. Serve immediately or cover and refrigerate until serving. Leftovers can be kept in the refrigerator, covered, for up to three days.