From b5038e526a609c503fafd83a19b4406e0434a5bc Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Sun, 8 Nov 2020 17:20:18 +0100 Subject: [PATCH] historian: Ensure parser is called with bytes --- historian/cli/db.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/historian/cli/db.py b/historian/cli/db.py index aeb3883..42ddf9c 100644 --- a/historian/cli/db.py +++ b/historian/cli/db.py @@ -35,6 +35,8 @@ def merge(source, destination): total=meta['channel_announcements'], ): msg = parse(r) + if isinstance(r, memoryview): + r = bytes(r) target.merge(ChannelAnnouncement.from_gossip(msg, r)) for r, in tqdm( @@ -42,6 +44,8 @@ def merge(source, destination): total=meta['channel_updates'], ): msg = parse(r) + if isinstance(r, memoryview): + r = bytes(r) target.merge(ChannelUpdate.from_gossip(msg, r)) for r, in tqdm( @@ -49,6 +53,8 @@ def merge(source, destination): total=meta['node_announcements'], ): msg = parse(r) + if isinstance(r, memoryview): + r = bytes(r) target.merge(NodeAnnouncement.from_gossip(msg, r)) target.commit()