The policy of the law is that where parties have, respectively, claims against each other arising out of contract, the person owing the larger sum shall not be required to pay any greater amount than the difference upon which the demands will be extinguished. The principle was first established by the courts of equity in cases where for special reasons injustice would •otherwise ensue. But it is now regarded as of general application, is highly favored, and by the statutes relating to set-off and counter-claim can in most ■cases be applied in legal actions. The present action is in equity for an accounting, and, if insolvency on the part of the plaintiff, or other hardship, were shown, it is probable defendant would be protected without reference to the statute. No such circumstance appears, but we are of opinion that the •case falls within the statute. Both demands are upon contract. Originally they were between the same parties. Both were in existence before plaintiff •assigned his claim. Had the cause of action remained with, and the suit been brought by, the assignee, defendant’s only relief would have been to use his •demand as a set-off. The claim being transferred back to the assignor, jointly with his wife, defendant’s claim can be availed of as a set-off against the wife, and, if the claim established by the defendant exceeds that of the plaintiff an affirmative judgment can be had against the husband. The action is in equity, and costs will be in discretion. It follows that the judgment appealed from must be reversed, the demurrer overruled, and plaintiff may rely •upon payment of the costs of the general term.