diff --git a/src/lib/data_structures/publication_tree.ts b/src/lib/data_structures/publication_tree.ts index e7e0e41..7f6c968 100644 --- a/src/lib/data_structures/publication_tree.ts +++ b/src/lib/data_structures/publication_tree.ts @@ -89,8 +89,9 @@ export class PublicationTree implements AsyncIterable { parent: parentNode, children: [], }; - parentNode.children!.push(new Lazy(() => Promise.resolve(node))); - this.#nodes.set(address, new Lazy(() => Promise.resolve(node))); + const lazyNode = new Lazy(() => Promise.resolve(node)); + parentNode.children!.push(lazyNode); + this.#nodes.set(address, lazyNode); this.#events.set(address, event); }