plugins: structure plugin storage in wallet
store all plugin data by plugin name in a root dictionary `plugin_data` inside the wallet db so that plugin data can get deleted again. Prunes the data of plugins from the wallet db on wallet stop if the plugin is not installed anymore.
This commit is contained in:
@@ -189,6 +189,11 @@ class StoredDict(dict):
|
||||
self.db.add_patch({'op': 'remove', 'path': key_path(self.path, key)})
|
||||
return r
|
||||
|
||||
def setdefault(self, key, default = None, /):
|
||||
if key not in self:
|
||||
self.__setitem__(key, default)
|
||||
return self[key]
|
||||
|
||||
|
||||
class StoredList(list):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user