mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-19 22:24:19 +01:00
datastore: change keys into an array.
We store this internally as hex, since shelve insists on string keys. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
2ec769e05b
commit
0b9e6c9517
@@ -2,7 +2,6 @@
|
||||
from pyln.client import Plugin, RpcError
|
||||
import shelve
|
||||
import os
|
||||
from collections import namedtuple
|
||||
|
||||
|
||||
plugin = Plugin()
|
||||
@@ -16,9 +15,9 @@ def unload_store(plugin):
|
||||
return
|
||||
|
||||
plugin.log("Emptying store into main store (resetting generations!)", level='unusual')
|
||||
for k, (g, d) in datastore.items():
|
||||
for k, (g, data) in datastore.items():
|
||||
try:
|
||||
plugin.rpc.datastore(k, d.hex())
|
||||
plugin.rpc.datastore(key=[k], hex=d.hex())
|
||||
except RpcError as e:
|
||||
plugin.log("Failed to put {} into store: {}".format(k, e),
|
||||
level='broken')
|
||||
|
||||
Reference in New Issue
Block a user