There is no doubt of the general principle, that the defendant, II. P. Martin who is surety in the bond sued on, is entitled to all the legal and equitable defenses to which his principal, T. S. Martin, was entitled, which attached to or was connected with the debt sued on ; for instance, to all payments endorsed and to all set offs and counter claims. Whether he would be entitled to the benefit of any independent claim of his principal against the creditor, as for instance, a bond, so that his principal could not assign it to another, is not necessary to be decided in this case.
If, therefore, the defendant can prove what he proposed to prove, that his principal had claims against the creditor, which were contracted with reference to the bond sued on, or which were agreed to be in liquidation in whole or in part, it is clearly competent for him to do so. This proposition would probably not be denied if it stood alone; but it is objected that when the principal debtor went into bankruptcy, he listed the claims which he had against the plaintiff, and thereby they were assigned to the assignee in bankruptcy by operation of law, and will have to be paid by tbe plaintiff to tbe assignee. We suppose this would not be so even if they were listed by the bankrupt without an express saving of, or reference to the rights of the plaintiff; but certainly it is not so, if, as tbe defendant offered to prove, they were rendered in bankruptcy with express reference to,'and ratification of, the plaintiff’s *462claim against the bankrupt. In which case the assignee in bankruptcy would take the claims oum onere.
From what has been said it will be seen that the assignee in bankruptcy ought to be a party, because the plaintiff ought not to be put to the risk of allowing the claims to the defen-7 dant, and having to pay them to the assignee in bankruptcy.
The question, as to the competency of the bankrupt to testify as to transactions between him and the deceased creditor, Puryear, is not necessary to be decided now, and will probably not arise on the next trial:
There is error.
Pee CüRXam, Venire de novo.