
76 Cal.App.2d 501 (1946)
WILLIAM F. NELSON, Appellant,
v.
BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION (a National Banking Association), Respondent.
Civ. No. 7252. 
California Court of Appeals. Third Dist.  
Oct. 16, 1946.
 G. H. Van Harvey for Appellant.
 G. D. Schilling and R. I. McCarthy for Respondent.
 THOMPSON, J.
 The plaintiff had a deposit credit in the defendant's bank at Crescent City of $1,200. The bank held his matured note for $2,500 and accrued interest, secured by chattel mortgage on an ocean fishing boat. The bank sold the boat under the terms of the mortgage and applied the $1,200, pursuant to section 3054 of the Civil Code to the payment of the balance due on the note. Plaintiff sought to withdraw his deposit of $1,200, which was refused by the bank. Plaintiff brought this suit in assumpsit against the bank for said sum of $1,200. The complaint also alleged conversion of the money by the bank. The defendant answered, denying its indebtedness to plaintiff and setting up its counterclaim of the balance due on plaintiff's note. The court rendered judgment against plaintiff to the effect that he is entitled to nothing by his action for the reason that defendant was not indebted to him in any sum whatever. From that judgment plaintiff has appealed.
 The appellant contends that the bank was not authorized to apply his deposit of $1,200 to the payment of his matured note for the reason that the note was secured by chattel mortgage on the boat, and that plaintiff's attorney in fact was without authority to consent to the bank's application of the deposit to the debt, or to enter into a subsequent contract for the repurchase of the boat.
 The defendant conducted a banking business in Crescent City. The plaintiff had on deposit in the bank the sum of $1,200. May 7, 1938, plaintiff executed and delivered to the bank his promissory note, payable May 6, 1939, for $2,500 with interest at 7 per cent per annum payable quarterly, secured by a chattel mortgage on an ocean motor boat named "Roamer." On account of default in payment of the note, the bank sold the boat under the terms of the mortgage for $2,300. The bank purchased the boat at that sale. There still remained unpaid on the note, including the costs of sale, an amount in excess of $1,200. The bank then applied plaintiff's deposit in the bank of $1,200, under section 3054 of the Civil Code, toward the satisfaction of that unpaid balance of indebtedness. The evidence *503 shows that, on April 23, 1943, there was due to the bank on account of said loan, the aggregate sum of $3,731.65.
 The plaintiff had moved to Napa, California, where he resided in 1943. About April 1, 1943, on account of default in payment of the note, the defendant demanded prompt payment thereof, and after notice of default the foreclosure and sale of the boat was set for April 16th of that year. In the meantime, about April 7th, plaintiff demanded payment of his deposit of $1,200, which was refused. The appellant employed John L. Childs, an attorney at Crescent City, to represent him in the transaction, and executed to him a power of attorney for that purpose. Childs promptly conferred with the manager of the bank, who insisted upon prompt payment of the note, but agreed to and did continue to April 23d the foreclosure and sale of the boat. The bank manager asserted the right to apply plaintiff's deposit of $1,200 on payment of any balance remaining unpaid on the bank's secured note, after foreclosure and sale of the boat. Childs told the manager of the bank of his power of attorney from plaintiff. On April 22, 1943, the bank and Childs, as attorney in fact of plaintiff, executed a conditional agreement, by the terms of which it was assumed the foreclosure and sale would proceed on the following day, but that, if the bank became the purchaser of the boat at said sale for a sum not to exceed $2,700, and plaintiff assigned to the bank his title to the deposit of $1,200, and installed in the boat the engine which had been removed therefrom, and placed the boat in good "seagoing condition," and executed and delivered to the bank his note for $2,000, payable in monthly installments, secured by a "first preferred ship mortgage" on the boat, all to be performed within 30 days from April 22d, the bank would then give plaintiff a bill of sale to the boat reconveying all its interest therein.
 As a part of that transaction, at the request of the defendant, Childs communicated with the plaintiff at Napa, and sent to him a telegram, requesting authorization to transfer the $1,200 credit to the bank in part payment of his indebtedness, which was authorized by a reply telegram. In compliance therewith Childs drew and delivered to the bank a check of $1,200 on April 23d, signed "Wm. F. Nelson, By John L. Childs, his Attorney-in-fact." The other terms and conditions of the written agreement were not fulfilled by the plaintiff. He neither installed the engine, nor placed the boat in seagoing condition. Nor did he execute the new note for $2,000 *504 or the chattel mortgage as security therefor. The appellant contends that the agreement was unauthorized and void.
 April 23d, the foreclosure sale was held pursuant to the terms of the chattel mortgage. The defendant bought the boat for $2,300. The uncontradicted evidence shows that the costs of sale amounted to $514.03. The defendant then applied the net purchase price of the boat, amounting to $1,785.97 to the payment of the secured note and accumulated interest. The security was thereby exhausted and terminated. There remained an unpaid, unsecured balance on the indebtedness in excess of $1,200. The bank then applied plaintiff's deposit credit of $1,200, under section 3054 of the Civil Code, toward the payment of the balance of plaintiff's indebtedness. June 23, 1943, the bank sold the boat to James Thompson for $2,000.
 February 10, 1944, plaintiff brought this suit in assumpsit to recover his deposit of $1,200. The third count of the complaint charged the defendant with conversion of the funds. The defendant answered, denying the essential allegations of the complaint and pleaded plaintiff's indebtedness on the note as a counterclaim. The court adopted findings favorable to the defendant in every respect and rendered judgment to the effect that defendant is not indebted to plaintiff in any sum and that plaintiff take nothing by his cause of action. From that judgment plaintiff has appealed.
 The proved facts with relation to the transaction and sale are as follows:
 May 7, 1938, plaintiff executed the chattel mortgage on the boat to secure the $2,500 note. Article XVIII of the mortgage provides that, in the event of default the mortgagee may take possession of the boat "without legal process," and after specified notice may sell the same at a designated place, without the presence of the boat, and that "the mortgagee may become the purchaser at said sale." It also provides that the mortgagee shall be entitled to the costs of sale.
 It appears that the boat was sold in accordance with the terms of the mortgage. There is no evidence to the contrary.
 After default and demand for payment of the note April 1, 1943, the foreclosure and sale of the boat was set for April 16th of that year. After conference with John L. Childs, who represented the plaintiff, the sale was continued to April 23d. April 14th, plaintiff executed a written power of attorney to Mr. Childs. It gave him authority, "to grant, bargain, sell, assign, transfer and set over, for such sum or price, and on *505 such terms as to him shall seem meet, the fishing boat known as the 'Roamer,' .... And for me and in my name to sign and execute all necessary papers to that end. Giving and granting to my said Attorney full power and authority to do and perform all and every act and thing whatsoever requisite and necessary to be done."
 The defendant then claimed and demanded payment of plaintiff's $1,200 deposit to apply on the matured debt to the bank. At the request of the bank Mr. Childs sent to plaintiff at Napa the following telegram:
 "Send following telegram immediately"
 'J. Wilson Manager Bank of America N.T.S.A. Crescent City c/o Bank of Bandon, Bandon, Oregon:
 John L. Childs is authorized to sign checks Savings Withdrawals and transact all business with your bank as Attorney in fact for me. Signed Wm. F. Nelson.' ...
 John L. Childs.""
 In reply to that message plaintiff sent to the bank the following telegram on April 23, 1943:
 "John L. Childs is my Attorney intact [in fact] to dispose of the Twelve Hundred Dollars in my name in the bank at Crescent City. Signed W. F. Nelson."
 Pursuant to that telegram Mr. Childs signed and delivered to the bank on April 23d a check for $1,200 on plaintiff's bank account. It was signed "Wm. F. Nelson By John L. Childs his Attorney-in-fact."
 In May, 1943, after the sale of the boat and application of the plaintiff's bank credit of $1,200 on the balance of the indebtedness remaining after the sale, the defendant prepared and presented a written agreement to resell the boat to plaintiff on specified terms, which plaintiff refused to sign.
 The day before the sale occurred, the bank and John L. Childs, as plaintiff's attorney-in-fact, executed a written agreement, as we have previously stated, providing that if the defendant became the purchaser of the boat at the sale, defendant would resell and convey it to plaintiff "within thirty days from the date hereof," conditioned upon plaintiff installing the engine, which had been removed, placing the boat in "seagoing condition," paying to the bank said $1,200 deposit, and executing and delivering plaintiff's note for the additional sum of $2,000, and interest, payable in monthly installments, secured by a "First Preferred Ship Mortgage" on the *506 boat. This agreement was not fulfilled by plaintiff. It was repudiated by him. He even denied the authority of Mr. Childs, as authorized by the telegram from him, to draw the check for $1,200 on his bank account. Thereafter, the bank sold the boat to James Thompson, on June 23, 1943, for $2,000.
 After default of plaintiff's $2,500 note, the chattel mortgage appears to have been foreclosed and the boat sold pursuant to the terms of that security. The security was thereby exhausted and terminated. A balance of that indebtedness in excess of $1,200 still remained unpaid. The bank applied the $1,200 deposit of plaintiff toward the payment of that balance.
 The chief contention of the appellant is that John L. Childs, his attorney-in-fact, was not authorized by his power of attorney or by the telegram, to either pay to the bank the $1,200 deposit, or to enter into the agreement to repurchase the boat. While there is ample evidence to support the authority of Mr. Childs, in view of our construction of the law it seems to be unnecessary to determine that controversy. [1] The real issue is whether the defendant owes plaintiff the $1,200 deposited in its bank. Plaintiff's matured debt on his note secured by chattel mortgage is not disputed. The question of defendant's indebtedness to plaintiff depends upon the legal right of defendant to apply plaintiff's deposit of $1,200, under section 3054 of the Civil Code, to the payment of the balance due to the bank after the foreclosure and sale of the boat to satisfy the secured note. We are of the opinion the bank had that right regardless of the authority of plaintiff's power of attorney under which the check was drawn and the amount of the deposit paid to the defendant. The disputed authority of Childs under his power of attorney and the telegram from plaintiff may be disregarded.
 Section 3054 of the Civil Code provides that:
 "A banker has a general lien, dependent on possession, upon all property in his hands belonging to a customer, for the balance due to him from such customer in the course of the business."
 In construing that section the Supreme Court said in Arnold v. San Ramon Valley Bank, 184 Cal. 632, at page 635 [194 P. 1012, 13 A.L.R. 320]:
 "Since the relation between Taylor and the bank, growing out of the deposit, was that of creditor and debtor, and the debt of Taylor was due, it follows that the bank had the right of setoff to the extent of any debt it then held against Taylor. *507 The debt due from the bank to Taylor on account of the deposit and the note of Taylor to the bank were cross- demands. If either had sued the other upon such demand, the other could have pleaded the cross-demand as a counterclaim. Consequently, the two demands are 'deemed compensated so far as they equal each other.' [Citing authorities.]"
 To the same effect is the recent case of Bromberg v. Bank of America, 58 Cal.App.2d 1 [135 P.2d 689].
 It was true, prior to the amendment of section 438 of the Code of Civil Procedure in 1927, that while the counterclaim of the bank remained secured by mortgage, the bank was precluded from applying the customer's deposit credit to that indebtedness. (McKean v. German-American Savings Bank, 118 Cal. 334 [50 P. 656]; Gnarini v. Swiss American Bank, 162 Cal. 181 [121 P. 726]; First National Bank v. Coplen, 39 Cal.App. 619 [179 P. 708].) In the cases previously cited, upon which the appellant relies, it appears that the mortgage securities of indebtedness due to the banks had not been foreclosed, but were held by the banks at the times they sought to apply customers' deposits to their indebtedness under section 3054 of the Civil Code. Those cases hold that such application of deposits in banks may not be made to debts which are secured by mortgages unless and until the mortgages are first foreclosed and the property sold in accordance with their terms. The clear inference is that when the securities have been exhausted by foreclosure and sale, and a balance of the indebtedness remains unpaid, a bank has the right to offset the unpaid balance of the then unsecured debt by application of the debtor's credit on deposit in the bank. In the McKean case, supra, the court said in that regard, at page 339:
 "As I read the decisions of this court they mean that the mortgagee, whether a banking corporation or a private individual, must first look to the mortgaged premises as constituting the primary fund out of which the debt secured by the mortgage must be paid (Porter v. Muller, supra [65 Cal. 512 (4 P. 531)], and other cases cited]; that the security must be first exhausted; if there be a deficiency it may be docketed, but this deficiency judgment does not become a lien on any real property, and execution will not issue upon it until after the sale under foreclosure." (Italics added.)
 In the present case, before this suit was commenced, the bank foreclosed the chattel mortgage given to secure the note of plaintiff and sold the boat under the terms of the *508 mortgage for $2,300. That sum, less the costs of sale, was applied to the payment of the note, leaving an unpaid balance due to the bank in excess of $1,200. The mortgage security was thereby exhausted, as suggested by the court in the McKean case. The unpaid balance on the note was not then secured. The bank therefore properly applied plaintiff's deposit of $1,200 toward paying that unsecured balance. (J. I. Case T. M. Co. v. Copren Bros., 32 Cal.App. 194 [162 P. 647].) The Copren Bros. case is in exact accordance with the suggestion of the Supreme Court in the previously cited cases, with respect to the application of the banker's lien on deposits of a customer to a balance due on a secured note after the mortgage has been foreclosed and the property sold.
 [2] In the present case, the appellant invokes the provisions of section 726 of the Code of Civil Procedure, which he contends precludes the defendant from setting up the application of his bank deposit to the payment of the balance of his debt due to the bank, as a defense to this suit in assumpsit, because the note was originally secured by chattel mortgage. But the record discloses the fact that, at the time of the commencement of this suit, after the sale of the boat, that unpaid balance was not then secured by mortgage. The Copren Bros. case, supra, disposes of that contention adversely to the appellant. In that case a hearing by the Supreme Court was denied. That decision has not been overruled or modified. The facts of that case fit the situation in the present action. In that case plaintiff brought suit against the defendants for a balance due on their three promissory notes originally secured by chattel mortgage, after first selling the mortgaged property under the terms of the security. Judgment was rendered in favor of the plaintiff. The judgment was affirmed on appeal. The appellants contended plaintiff could not maintain the action for the balance due until a deficiency judgment had been first entered after foreclosure of the mortgage as distinguished from a sale of the property pursuant to the terms of the security. The appellate court held otherwise. The court said:
 "It must be held that when this action was begun the debt was not secured by a mortgage. The property that was security for it had been sold by the plaintiff and the defendants given credit therefor. It had been sold pursuant to defendants' written consent and authorization contained in the mortgage. In making the sale the plaintiff may be said to have *509 been acting as the defendants' agent. One object of the passage of section 726 of the Code of Civil Procedure was to compel one having a debt secured by a mortgage to exhaust his security and apply its value to the liquidation of the claim before proceeding to obtain a personal judgment as against his debtor. Many conditions may arise after a mortgage has been given rendering what was originally security for the debt valueless. In most cases, perhaps, it might be a correct statement of the law to say that the word 'secured,' as used in section 726, should be considered as used in the present tense, and that the section refers to a debt that, at the time suit is brought, is secured by a mortgage. The adoption of the above as a general rule of construction would be subject to exceptions in individual cases. Thus, perhaps, if one having a debt secured by a mortgage should cancel it of record, without the consent of the mortgagor, it might be held he could not bring a personal action. On the other hand, if such mortgage were canceled with the consent or at the request of the mortgagor, without any intention of canceling the indebtedness, or if the property, being personal, were all destroyed by fire, without fault of the mortgagee--in such cases the holder of the indebtedness would not be at all prevented by section 726 from bringing and maintaining a personal action for the amount due. So in this case, the property having been sold by the plaintiff acting under the written authorization of the defendants and having ceased to be security for any part of the balance due, the notes were not secured by a mortgage at the time the suit was brought, and section 726 has no application to the situation."
 We think the Copren Bros. case is determinative of this appeal.
 [3] No formal procedure on the part of the bank is necessary to entitle it to the benefit of an offset of a customer's deposit therein, in payment of his indebtedness to the bank under section 3054 of the Civil Code. The banker has the statutory right to apply the deposits of a customer to the payment of his matured debt to the bank, without notice. [4] In a suit against the bank, by a customer, to recover funds deposited therein, which have been applied under section 3054 of the Civil Code to the payment of his matured debt to the bank, it is not necessary for the bank to set up that transaction as a cross-complaint and ask for affirmative relief. (Bromberg v. Bank of America, supra; Melander v. Western *510 National Bank, 21 Cal.App. 462 [132 P. 265].) In such action, the defendant, however, may set up a counterclaim and ask for affirmative relief under section 438 of the Code of Civil Procedure. That section was amended in 1927 by enlarging the scope of a counterclaim. (Hanes v. Coffee, 212 Cal. 777, 780 [300 P. 963].) Prior to the amendment of that section it contained no provision that a counterclaim could be set up as a defense when it was secured by mortgage. The amendment in 1927 specifically provides that "the right to maintain a counterclaim shall not be affected by the fact that either plaintiff's or defendant's claim is secured by mortgage or otherwise." In the case of Cohen v. Bonnell, 14 Cal.App.2d 38 [57 P.2d 1326], which was decided in 1936, plaintiff brought suit on a note for $11,000, secured by mortgage. The defendant answered, setting up a counterclaim of a note of plaintiff for $16,615, also secured by a trust deed. The defendant had previously sold personal property secured by the trust deed and applied the proceeds toward payment of the debt. There remained due to defendant, however, a secured balance amounting to $17,000, which he sought to offset against plaintiff's demand. The trial court allowed the offset and rendered judgment against plaintiff accordingly. On appeal that judgment was affirmed. The Supreme Court denied a hearing. In affirming the judgment the appellate court said:
 "The fact that the note here in question was secured by a mortgage is immaterial under the provisions of section 438 of the Code of Civil Procedure, which permits a counterclaim to be set up whether the same is secured by mortgage or otherwise, and even in cases where the action is one to foreclose the security. (Hanes v. Coffee, 212 Cal. 777 [300 P. 963].)"
 In a suit by a customer of a bank to recover deposits therein, since the amendment of section 438 of the Code of Civil Procedure, the bank has a right to set up as a counterclaim the customer's debt to the bank, regardless of whether it is secured by mortgage or not. In this case the defendant had a right to set up the plaintiff's debt even though it was secured by mortgage. But the mortgage had been foreclosed and the property sold pursuant to the terms of the chattel mortgage. The balance due to the bank was therefore unsecured. The security was exhausted and terminated.
 The judgment is affirmed.
 Adams, P. J., and Peek, J., concurred.
