From 07571f2f7335f96350edc9754148640397a35ff9 Mon Sep 17 00:00:00 2001 From: pdxlocations <117498748+pdxlocations@users.noreply.github.com> Date: Tue, 19 Nov 2024 19:45:33 -0800 Subject: [PATCH] always update packet buffer --- curses-client.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/curses-client.py b/curses-client.py index 87d3b9b..e77a2d4 100644 --- a/curses-client.py +++ b/curses-client.py @@ -141,11 +141,12 @@ def on_receive(packet, interface): global all_messages, selected_channel, channel_list, packet_buffer # update packet log + packet_buffer.append(packet) + if len(packet_buffer) > 20: + # trim buffer to 20 packets + packet_buffer = packet_buffer[-20:] + if display_log: - packet_buffer.append(packet) - if len(packet_buffer) > 20: - # trim buffer to 20 packets - packet_buffer = packet_buffer[-20:] update_packetlog_win() try: if 'decoded' in packet and packet['decoded']['portnum'] == 'NODEINFO_APP':