From 06b9194ac28a5a4deaae4d2212117ccbcdd34fa8 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 15 Jul 2021 22:21:31 -0700 Subject: [PATCH] bugfix --- appPublic/dataencoder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appPublic/dataencoder.py b/appPublic/dataencoder.py index b4d2836..fe8773e 100644 --- a/appPublic/dataencoder.py +++ b/appPublic/dataencoder.py @@ -125,7 +125,8 @@ class DataEncoder: org_data = data pk = self.get_peer_pubkey(peer_id) f = data[:18] - f.strip(b'\x00') + while f[-1] == b'\x00' and len(f) > 0: + f = f[:-1] f = f.decode('utf-8') data = data[18:] t, d, k, s = struct.unpack(f, data)