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:
ThomasV
2025-07-09 10:31:32 +02:00
parent 53c1817956
commit 077bcf515d
6 changed files with 109 additions and 77 deletions

View File

@@ -773,7 +773,7 @@ class Channel(AbstractChannel):
Logger.__init__(self) # should be after short_channel_id is set
self.lnworker = lnworker
self.storage = state
self.db_lock = self.storage.db.lock if self.storage.db else threading.RLock()
self.db_lock = self.storage.lock
self.config = {}
self.config[LOCAL] = state["local_config"]
self.config[REMOTE] = state["remote_config"]