The issue in this case is whether the Superior Court (Dalianis, J.) properly enjoined the defendant from foreclosing its mortgage on the plaintiffs’ property. We hold that the defendant was entitled to foreclose in order to collect interest that *181had accrued on a note executed by the plaintiffs. Accordingly, we reverse.
In October 1976, the plaintiffs executed a promissory note to Southern New England Production Credit Association (Southern). The note was secured by a lien on the “Two Jims,” a shipping vessel, and by a second mortgage in the amount of $75,000 on real estate the plaintiffs owned in Brookfield, New Hampshire. Three years later, the vessel was forfeited to the United States Government for violations of customs and narcotics laws. It was sold at a public auction conducted by the United States Government for $149,000 in late December 1979, and the proceeds were delivered to the clerk of the United States District Court for the District of New Hampshire (the federal district court).
Creditors of the plaintiffs submitted claims for the proceeds. The defendant, one of the creditors, filed an affidavit on January 18, 1980, stating that, as of that date, its claim against the plaintiffs amounted to $107,966.51, which represented the balance due on the October 1976 note.
The Federal District Court (Devine, C.J.) awarded Southern $107,966.51 on January 24, 1980. One week later the defendant, still unpaid, advised the federal district court that if the matter were “delayed further” it wished to amend its affidavit to reflect the interest that had accrued since the original affidavit was submitted.
After an additional hearing regarding the claims of other creditors, the federal district court on March 31, 1980, held that $107,966.51 of the proceeds should be disbursed to Southern. Southern objected, claiming that figure was no longer valid due to the accrual of interest at $40.66 per day. Southern received $107,966.51 on May 15, 1980, but did not receive the $4,837.16 in interest which it requested. The court, however, refused to pay interest out of the proceeds available from the sale of the ship.
Southern then began to foreclose its mortgage on the plaintiffs’ Brookfield, New Hampshire, real estate in order to recover the interest on the plaintiffs’ note. The plaintiffs obtained a permanent injunction against foreclosure from the superior court, and the defendant appealed.
We agree with Southern that the federal district court proceeding did not extinguish the plaintiffs’ d^bt, which the plaintiffs assert is “paid in full.” Neither the federal district court nor the superior court ruled that the plaintiffs’ debt was paid. In fact, the superior court neither granted nor denied the defendant’s request for a ruling that “the note and mortgage ... are still outstanding.”
*182A mortgagor’s debt is extinguished only when he performs the “obligation which the mortgage was given to secure.” Phinney v. Levine, 116 N.H. 379, 380, 359 A.2d 636, 638 (1976). The plaintiffs’ debt was not extinguished because they had not performed their obligations under the mortgage. The plaintiffs’ January 1978 mortgage was a power-of-sale mortgage under the statutory conditions listed in RSA 477:29(b). One condition is that the mortgagor “shall pay . . . the principal and interest secured by the mortgage” to the mortgagee. RSA 477:29(b) (emphasis added). Breach of this condition entitles the mortgagee to foreclose. RSA 477:29(c); RSA 479:27; RSA 479:25, :26, :27-a (Supp. 1979). Because the plaintiffs owed interest and the defendant was entitled to foreclose, the superior court erred in granting the plaintiffs’ petition.
The plaintiffs assert that the federal district court order, in which the court refused to award interest, was determinative of the interest issue. We disagree. In denying Southern’s claim for interest, the court reasoned as follows: “As is obvious from examination of the dollar amounts of claims made as against the proceeds available ... to allow Southern an award of interest in addition to its claimed $107,966.51 would work a substantial hardship upon the remaining lienholders.” This quote indicates that the court refused to award interest to the defendant because such an award would have depleted the proceeds of the ship sale and deprived junior creditors of any recovery.
The technique of protecting junior creditors is known as “marshaling the assets.” When “one creditor may have recourse to two funds more than ample for his full satisfaction, while a junior creditor has recourse to but one fund, which will prove inadequate for his payment if the senior creditor has primary recourse to it,” the court will often “marshal the assets” and compel the former to exhaust the fund on which he alone has a lien before allowing him to use the other fund. Sanborn, McDuffee Co. v. Keefe, 88 N.H. 236, 238-39, 187 A. 97, 98-99 (1936); see Kidder v. Page, 48 N.H. 380, 382 (1869). The federal district court rejected Southern’s claim for interest in order to protect the junior creditors. The court essentially marshaled the available assets; but it did not rule that Southern was forever barred from recovering interest.
Because we are satisfied that the federal district court action concerned the proceeds of the impounded ship alone, we reject the plaintiffs’ argument that Southern is barred by res judicata from pursuing its interest claim. Res judicata would prevent Southern from asserting its claim only if the matters litigated in *183this proceeding were “directly in issue, and either admitted by the pleadings or actually tried” in a prior action. Laconia Nat. Bank v. Lavallee, 96 N.H. 353, 355, 77 A.2d 107, 108 (1950) (citations omitted); see Town of Nottingham v. Lee Homes, Inc., 118 N.H. 438, 444, 388 A.2d 940, 943 (1978). Nothing concerning Southern’s mortgage was pleaded, tried, or otherwise raised in federal district court. Southern, therefore, is not bound by that court’s decree denying recovery of interest because the decree was rendered in an entirely different context.
In a request it submitted to the superior court, Southern asked for attorney’s fees and costs. The request was erroneously denied. In their October 1976 note, the plaintiffs agreed to the following: “In the event this note is placed in the hands of an attorney for collection or suit is brought on the same, or any portion thereof, or if collected by any court proceedings, the undersigned, jointly and severally agree to pay reasonable attorney’s fees and costs of collection as may be permitted by law to be charged.” Accordingly, we find the plaintiffs liable for attorney’s fees and costs.
Although it is unclear from the record whether the trial court enjoined Southern’s foreclosure because of “laches,” the issue of laches was raised on appeal, and we feel compelled to address it. The plaintiffs suffered no inequity, prejudice, or surprise, especially because they “knew all along that [the defendant] was attempting to pursue his claim.” Wood v. General Elec. Co., 119 N.H. 285, 289, 402 A.2d 155, 157-58 (1979). The doctrine of laches, therefore, is inapplicable.
We remand for dissolution of the injunction and for an assessment of attorney’s fees and costs.
Reversed and remanded.
All concurred.