Practice point:  A purchaser seeking specific performance of a real estate contract must 
demonstrate that he or she was ready, willing, and able to perform on 
the contract, regardless of any anticipatory breach by the selle.  An anticipatory breach of the contract excuses the purchaser from
 tendering performance, but does not excuse the purchaser from the 
requirement of being ready, willing, and able to perform.
In order to retain the down payment, the seller must have been ready, willing, and able to perform on the law day. There are exceptions to this rule, such as where the purchaser seeks to
 cancel the contract without giving the seller an opportunity to cure 
any defects. In order to get a return of 
the down payment, the purchaser is not required to tender performance 
and attend a closing if the seller is unable to perform on the law day.
Case:  33 Park Ave. Realty, LLC v. Park Ave. Bldg. & Roofing Supplies, LLC, NY Slip Op 08802 (2d Dep't December 20, 2017)
Here is the decision.