Refactor error tracking to be edge-triggered with node setters

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2026-01-28 23:06:26 -08:00
parent ed9a0cd60d
commit 99083ecde5
7 changed files with 150 additions and 243 deletions

View File

@@ -130,6 +130,7 @@ func (n *Nodes) createNode() *Node {
ID: newID("node"),
Interfaces: InterfaceMap{},
MACTable: map[string]string{},
errors: n.t.errors,
pollTrigger: make(chan struct{}, 1),
}
n.nodes = append(n.nodes, node)
@@ -456,6 +457,7 @@ func (n *Nodes) GetOrCreateByName(name string) *Node {
Names: NameSet{name: true},
Interfaces: InterfaceMap{},
MACTable: map[string]string{},
errors: n.t.errors,
pollTrigger: make(chan struct{}, 1),
}
n.nodes = append(n.nodes, node)