A comaker or surety against whom an action is commenced jointly or alone may, with the consent of his comaker or principal, counterclaim a debt or liquidated demand due from the plaintiff at the commencement of the action to such comaker or principal.
(Code 1852, §2243; Code 1867, §2645; Code 1876, §2994; Code 1886, §2681; Code 1896, §3731; Code 1907, §5862; Code 1923, §10176; Code 1940, T. 7, §354.)