arbiter implemented

This commit is contained in:
pippellia-btc
2025-05-30 15:32:46 +02:00
parent 7c17c1a16f
commit aeec9662c8
8 changed files with 273 additions and 8 deletions

View File

@@ -29,6 +29,16 @@ type Node struct {
Records []Record
}
// Added returns the time a node was added to the database.
func (n *Node) Added() (time.Time, bool) {
for _, rec := range n.Records {
if rec.Kind == Addition {
return rec.Timestamp, true
}
}
return time.Time{}, false
}
// Record contains the timestamp of a node update.
type Record struct {
Kind int // either [Addition], [Promotion] or [Demotion]