A written notice of the pendency of any action for recovery on a bond shall be filed with the treasurer. After the filing of such notice the treasurer shall not receive any money on account of the bond and shall have no authority to cancel the entries on the bond in the register or give a discharge of the bond without the written consent of the owner thereof until judgment has been rendered in the action or until it has been dismissed.
Upon the entry of judgment or dismissal of the action the clerk of the court shall
forthwith mail to the treasurer a certified copy of the judgment or other evidence sufficient to advise the treasurer of the judgment of the court in the action.