Liquid-metal transfer from an anode to a cathode without short circuiting