refactor(core): rename channel creating function

[no changelog]
M1nd3r/thp1
M1nd3r 2 months ago
parent e928fdbe22
commit eae3ff7d50

@ -122,7 +122,7 @@ _usage_counter = 0
cid_counter: int = 4659 # TODO change to random value on start cid_counter: int = 4659 # TODO change to random value on start
def get_new_unauthenticated_channel(iface: bytes) -> ChannelCache: def get_new_channel(iface: bytes) -> ChannelCache:
if len(iface) != _WIRE_INTERFACE_LENGTH: if len(iface) != _WIRE_INTERFACE_LENGTH:
raise Exception("Invalid WireInterface (encoded) length") raise Exception("Invalid WireInterface (encoded) length")

@ -14,9 +14,7 @@ def create_new_channel(iface: WireInterface, buffer: utils.BufferType) -> Channe
""" """
Creates a new channel for the interface `iface` with the buffer `buffer`. Creates a new channel for the interface `iface` with the buffer `buffer`.
""" """
channel_cache = cache_thp.get_new_unauthenticated_channel( channel_cache = cache_thp.get_new_channel(interface_manager.encode_iface(iface))
interface_manager.encode_iface(iface)
)
r = Channel(channel_cache) r = Channel(channel_cache)
r.set_buffer(buffer) r.set_buffer(buffer)
r.set_channel_state(ChannelState.TH1) r.set_channel_state(ChannelState.TH1)

Loading…
Cancel
Save