StoredDict: use pointers instead of path
Instead of storing its own path, each StoredDict element stores its own key and a pointer to its parent. If a dict is removed from the db, its parent pointer is set to None. This makes self.path return None for all branches that have been pruned. This passes tests/tests_json_db.py and fixes issue #10000
This commit is contained in:
+1
-2
@@ -1263,8 +1263,7 @@ class Peer(Logger, EventListener):
|
||||
"revocation_store": {},
|
||||
"channel_type": channel_type,
|
||||
}
|
||||
# set db to None, because we do not want to write updates until channel is saved
|
||||
return StoredDict(chan_dict, None, [])
|
||||
return StoredDict(chan_dict, self.lnworker.db)
|
||||
|
||||
@non_blocking_msg_handler
|
||||
async def on_open_channel(self, payload):
|
||||
|
||||
Reference in New Issue
Block a user