mirror of
https://github.com/lightningd/plugins.git
synced 2026-08-16 13:00:58 +02:00
backup: Ensure entries in the tx are bytes
We could end up in some cases with string-encoded statements.
This commit is contained in:
parent
2bee4a0fc2
commit
d28d68cb16
1 changed files with 2 additions and 1 deletions
|
|
@ -192,7 +192,8 @@ class FileBackend(Backend):
|
|||
def add_change(self, entry: Change) -> bool:
|
||||
typ = b'\x01' if entry.snapshot is None else b'\x02'
|
||||
if typ == b'\x01':
|
||||
payload = b'\x00'.join([t.encode('UTF-8') for t in entry.transaction])
|
||||
stmts = [t.encode('UTF-8') if isinstance(t, str) else t for t in entry.transaction]
|
||||
payload = b'\x00'.join(stmts)
|
||||
elif typ == b'\x02':
|
||||
payload = entry.snapshot
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue