multi: remove HaveNodeAnnouncement field from Node

Remove the 2 sources of truth here. If we have a signature for the
node, then we have the announcement.
This commit is contained in:
Elle Mouton authored and yyforyongyu committed 2025-11-12 22:54:04 +08:00
1 parent a394938dfd
commit 8f205e2d1c
15 files changed
+154 -182

No files matched your search

+4 -1
View File
@@ -227,11 +227,14 @@ func (s *Server) ImportGraph(ctx context.Context,
var err error
for _, rpcNode := range graph.Nodes {
node := &models.Node{
HaveNodeAnnouncement: true,
LastUpdate: time.Unix(
int64(rpcNode.LastUpdate), 0,
),
Alias: rpcNode.Alias,
// NOTE: this is a workaround to ensure that
// HaveAnnouncement() returns true so that the other
// fields are properly persisted. However,
AuthSigBytes: []byte{0},
}
node.PubKeyBytes, err = parsePubKey(rpcNode.PubKey)