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

+10 -12
View File
@@ -229,12 +229,11 @@ func parseTestGraph(t *testing.T, useCache bool, path string) (
}
dbNode := &models.Node{
HaveNodeAnnouncement: true,
AuthSigBytes: testSig.Serialize(),
LastUpdate: testTime,
Addresses: testAddrs,
Alias: node.Alias,
Features: testFeatures,
AuthSigBytes: testSig.Serialize(),
LastUpdate: testTime,
Addresses: testAddrs,
Alias: node.Alias,
Features: testFeatures,
}
copy(dbNode.PubKeyBytes[:], pubBytes)
@@ -566,12 +565,11 @@ func createTestGraphFromChannels(t *testing.T, useCache bool,
}
dbNode := &models.Node{
HaveNodeAnnouncement: true,
AuthSigBytes: testSig.Serialize(),
LastUpdate: testTime,
Addresses: testAddrs,
Alias: alias,
Features: features,
AuthSigBytes: testSig.Serialize(),
LastUpdate: testTime,
Addresses: testAddrs,
Alias: alias,
Features: features,
}
copy(dbNode.PubKeyBytes[:], pubKey.SerializeCompressed())
+18 -21
View File
@@ -193,13 +193,12 @@ func createTestNode() (*models.Node, error) {
pub := priv.PubKey().SerializeCompressed()
n := &models.Node{
HaveNodeAnnouncement: true,
LastUpdate: time.Unix(updateTime, 0),
Addresses: testAddrs,
Color: color.RGBA{1, 2, 3, 0},
Alias: "kek" + string(pub),
AuthSigBytes: testSig.Serialize(),
Features: testFeatures,
LastUpdate: time.Unix(updateTime, 0),
Addresses: testAddrs,
Color: color.RGBA{1, 2, 3, 0},
Alias: "kek" + string(pub),
AuthSigBytes: testSig.Serialize(),
Features: testFeatures,
}
copy(n.PubKeyBytes[:], pub)
@@ -2872,26 +2871,24 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
// Now check that we can update the node info for the partial node
// without messing up the channel graph.
n1 := &models.Node{
HaveNodeAnnouncement: true,
LastUpdate: time.Unix(123, 0),
Addresses: testAddrs,
Color: color.RGBA{1, 2, 3, 0},
Alias: "node11",
AuthSigBytes: testSig.Serialize(),
Features: testFeatures,
LastUpdate: time.Unix(123, 0),
Addresses: testAddrs,
Color: color.RGBA{1, 2, 3, 0},
Alias: "node11",
AuthSigBytes: testSig.Serialize(),
Features: testFeatures,
}
copy(n1.PubKeyBytes[:], priv1.PubKey().SerializeCompressed())
require.NoError(t, ctx.graph.AddNode(ctxb, n1))
n2 := &models.Node{
HaveNodeAnnouncement: true,
LastUpdate: time.Unix(123, 0),
Addresses: testAddrs,
Color: color.RGBA{1, 2, 3, 0},
Alias: "node22",
AuthSigBytes: testSig.Serialize(),
Features: testFeatures,
LastUpdate: time.Unix(123, 0),
Addresses: testAddrs,
Color: color.RGBA{1, 2, 3, 0},
Alias: "node22",
AuthSigBytes: testSig.Serialize(),
Features: testFeatures,
}
copy(n2.PubKeyBytes[:], priv2.PubKey().SerializeCompressed())