(b) The funds on deposit which are the subject of such an action may remain with such foreign banking corporation to the credit of the action until final judgment therein, and be entitled to the same interest as other deposits of the same class, and shall be paid by such foreign banking corporation in accordance with the final judgment of the court; or the deposit in controversy may be paid into court to await the final determination of the action, and when the deposit is so paid into court such foreign banking corporation shall be struck out as a party to the action, and its liability for such deposit shall cease.
(c) The costs in all actions against a foreign banking corporation to recover deposits shall be in the discretion of the court, and may be charged upon the fund affected by the action. 5. Deposits by custodian for a minor under part six of article seven of the estates, powers and trusts law. When any deposit of cash or securities shall be made with a branch in this state of a foreign banking corporation by a person purporting to act as custodian for a minor under part six of article seven of the estates, powers and trusts law or under a similar law of another state, the deposit together with any interest or dividends credited thereon may be paid or delivered to or upon the order of such person, or his successor as custodian, or to a minor upon the minor's attaining either eighteen years or twenty-one years, as provided in accordance with part six of article seven of the estates, powers and trusts law, if no custodian is acting at the time of such payment or delivery, and any receipt or order of such person, successor or minor shall be valid and sufficient release and discharge of the depositary for any payment or delivery so made. No depositary dealing with a person purporting to act as a custodian for a minor under said article shall be bound to inquire into any facts bearing upon the designation of such person as such custodian or the propriety of or authority for any act of such person under said article or otherwise or the age of the person designated as a minor. No depositary shall be liable for any act performed pursuant to the instruction or direction of any person purporting to act as custodian under said article unless the depositary has actual knowledge that such act, or the instruction or direction therefor, constitutes a breach of such person's obligations as such custodian, or unless the depositary performs such act with knowledge of such facts that acting pursuant to such instruction or direction amounts to bad faith.