Sawyer, J.
Upon the disclosure of Morrill, he must be discharged. In the receipt of the four hundred dollars, and in the transactions which resulted in the payment of that sum to the town, he was acting only as the town’s agent. If, at any time, he had the money under such circumstances that it could be attached in his hands, at the suit of Hill’s creditors, it must have been, if at all, before it had been passed to the credit of the town, and thus made their money. This was in fact done before the service of the writ upon him. He had then, in effect, delivered over the money to the town, in accordance with the agreement under which he received it, by entering it upon his account with the town, to their credit. This was the only way in which it could be paid over by him, as the receiving and disbursing agent of the town. When he had thus credited it, he stood in no other relation to it than as the depositary of the town’s money, and he could in no view be regarded as the trustee of Hill.
As to the liability of the town, the first question to be considered is, whether the four hundred dollars was paid upon a consideration in whole or in part illegal, because against public policy. Whether the illegality extends to the whole or only a part of the consideration, is immaterial. The contract was entire, and in such ease the whole is void, if tainted with illegality in any part. Carlton v. Whitcher, 5 N. H. 196; Hinds v. Chamberlain, 6 N. H. 225; Clark v. Ricker, 14 N. H. 44.
The agreement disclosed between Morrill, acting in behalf of the town, and the principal defendant, Hill, is in substance that the town, having an interest in the question of divorce, as incidentally affecting their liability to support the wife, agree to refrain from making opposition to the libel, if Hill would deposit the four hundred dollars with Gale, under the stipulation that it was to be paid over to the town if the divorce was obtained, and to be applied to the payment of the expenses already incurred in the sup*204port of the wife, and the balance to be held as an indemnity against future expenses. This agreement is clearly against the policy of the law, as being one entered into for promoting and facilitating the dissolution of the mai'riage relation between the parties to the libel. The principle upon which the case of Sayles v. Sayles, 21 N. H. (1 Fost.) 312, was decided, applies here. That was the case of a promissory note, given in consideration of the libellee’s forbearing to claim alimony out of the estate of the libellant, when the ground for claiming it was such as would constitute a defence to the libel. In that case, it appeared that the defence, if presented, would have defeated the decree. That fact, however, was not material to the point of the decision. The doctrine of the case is, that an agreement, having for its object the dissolution of the marriage contract, and designed to facilitate that result, is against the policy of the law. Here the town had an interest in defeating the decree, and proposed to make opposition to it. "With the consent of the libellee, and probably, on application to the court, without it, they would have been authorized to resist the application in her name. They might have presented a defence which would have defeated it. The object and purpose of the agreement was to bind the town to withhold opposition, and thus facilitate the divoi’ce, by refraining to oppose it, when their opposition might have developed facts material to be known in order to a proper determination of the cause. This was a fraud upon the law, the policy of which is to guard and uphold the marriage relation with a watchful vigilance. Upon principles of public policy, contracts which provide for bringing about a marriage between two parties for a reward, called marriage brokage contracts, are held void, as tending to improvident and ill advised matches. Drury v. Hook, 1 Vern. 412; Williamson v. Gihon, 2 Sch. & Lef. 357; Smyth v. Aykerill, 3 Atk. 566; 1 Story’s Eq., sec. 260. And when the marriage relation has been assumed, it is equally the policy of the law to *205sustain and uphold it. It therefore holds all contracts void which contemplate or provide for the future separation of the parties, or which are calculated to prevent future reconciliation; Chit, on Cont. 673; or which aim at effecting a dissolution of the marriage contract, except by a proper administration of the law, in the due course of judicial proceedings.
But, though the contract was void, Hill cannot recover back the money paid under it, in a suit against the town. Hanson v. Hancock, 8 T. R. 575. The parties being in pari delicto, are left by the law where, by the contract and their proceedings under it, they have left themselves. Bui. Nisi Prius 131; Tennant v. Elliot, 1 B. & P. 3; Farmer v. Russell, 1 B. & P. 278. The legal maxim, potior est conditio possidentis, applies in such case. One who has freely paid his money upon an illegal contract is particeps criminis, and no cause of action arises in his favor upon an implied promise to repay if. But when an insolvent debtor, or one in embarrassed circumstances, pajs his money upon such illegal consideration, he stands in relation to his creditors in the same position as if he had made a voluntary conveyance of his property. In contemplation of law, he has in fact parted with his money for no consideration; 1 Story Eq., secs. 353, 354; Clark v. Gibson, 12 N. H. 386; because it is no consideration which can be set up in a court of law. No one, however, but a bona fide creditor at the time of his thus parting with it, has the right to interfere unless the conveyance was fraudulent in fact, as made with the intent to defraud creditors, and then subsequent creditors may also interpose. Here there is no pretence of an intention to defraud, and there is nothing to show that the plaintiff was a creditor at the time the . money was agreed to be paid, nor indeed at any subsequent time; nor that Hill was insolvent, or in embarrassed circumstances. But as the disclosure, by agreement 'of the parties, is to be opened for further proceedings, if the question as to *206the insolvency or embarrassed condition of Hill should be held to be material, and as this may be material, upon its being made to appear by proper evidence that the plaintiff was a creditor at the time of the illegal agreement, it may be necessary to consider whether the town is to be held chargeable for the whole amount received under the illegal agreement, or as, in other cases, for the balance, after applying so much as may be necessary to any claims which appear to exist in their favor against Hill. The ground upon which the town is to be held chargeable, if at all, is that, having received the money of an insolvent debtor, upon an illegal consideration, they hold it subject to the claims of his creditors, because they cannot be permitted to set up the illegal contract in a court of law as the consideration upon which they received it. But they may set up any legal claim to it, as against creditors, for which they are not compelled to resort to the illegal agreement. The effect of the illegality in the contract is to place them, in respect to creditors, precisely in the situation in which they would stand if they had received and held the money without consideration; and if they had so received it, the extent to which they would be held chargeable would be for the balance after adjusting the equities between them and Hill. To hold that they should be chargeable for the whole amount, regardless of those equities, would be to subject them to a penalty in this suit for entering into the illegal agreement. Hutchins v. Sprague, 4 N. H. 469; Boardman v. Cushing, 12 N. H. 105. They can be placed in no worse position in this ease, as Hill’s trustee, than if they had merely disclosed that they had four hundred dollars of his money in their hands, but had a claim against him for expenses incurred in the support of his wife. There is nothing in the disclosure to show that, during all the time the wife was supported by the town down to the time of the divorce, Hill was not liable for her support. The terms of the agreement amount to an *207admission by him of his liability. It must be presumed that the support was furnished when he should have supplied it, and for this the town have their right of action against him. Tibbets v. Hapgood, 34 N. H. 420; Rumney v. Keyes, 7 N. H. 571. But they have no right, as against the creditors of Hill, if he is shown to have been in embarrassed circumstances, to retain the money as an indemnity against the expenses of the wife’s support, subsequently to the divorce. The husband then ceased to be liable for her support, and the town would have no legal claim against him on that account. Their only ground for retaining it to be so applied, is that Hill so agreed with them, upon the illegal consideration that they would forbear to oppose the divorce. The town, therefore, may be held liable for any balance of the four hundred dollars, after satisfying the expenses incurred in the support down to the time of the divorce, if the insolvency or embarrassed condition of Hill, and a bona fide indebtedness from him to the plaintiff, shall be made to appear. Leave is given to the plaintiff' to move that the disclosures be opened.