Structural basis underlying the dual gate properties of KcsA