If for any reason section 298.17 shall be held to be invalid, then all such taxes, when collected, shall be paid into the state treasury and credited to the general fund.