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:
1 parent
a394938dfd
commit
8f205e2d1c
15 files changed
+154
-182
No files matched your search
@@ -3495,7 +3495,6 @@ func buildNodeWithBatchData(dbNode sqlc.GraphNode,
|
||||
return node, nil
|
||||
}
|
||||
|
||||
node.HaveNodeAnnouncement = true
|
||||
node.AuthSigBytes = dbNode.Signature
|
||||
node.Alias = dbNode.Alias.String
|
||||
node.LastUpdate = time.Unix(dbNode.LastUpdate.Int64, 0)
|
||||
@@ -3608,7 +3607,7 @@ func upsertNode(ctx context.Context, db SQLQueries,
|
||||
PubKey: node.PubKeyBytes[:],
|
||||
}
|
||||
|
||||
if node.HaveNodeAnnouncement {
|
||||
if node.HaveAnnouncement() {
|
||||
params.LastUpdate = sqldb.SQLInt64(node.LastUpdate.Unix())
|
||||
params.Color = sqldb.SQLStrValid(EncodeHexColor(node.Color))
|
||||
params.Alias = sqldb.SQLStrValid(node.Alias)
|
||||
@@ -3622,7 +3621,7 @@ func upsertNode(ctx context.Context, db SQLQueries,
|
||||
}
|
||||
|
||||
// We can exit here if we don't have the announcement yet.
|
||||
if !node.HaveNodeAnnouncement {
|
||||
if !node.HaveAnnouncement() {
|
||||
return nodeID, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user