What changed, and why it matters
This commit is a straightforward code cleanup that changes a helper function to accept individual values instead of a whole object. It does not appear to fix or introduce any security issue. However, the diff contains one suspicious typo-like change in the default case where the function now returns `node1` instead of `node2`, which looks like a potential bug but is not a security vulnerability on its own.
No security action required. However, the apparent logic error in the default return case (`node1` instead of `node2`) should be reviewed for correctness by the maintainers, as it may affect which side can resurrect a zombie channel.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors makeZombiePubkeys in graph/db/kv_store.go and updates its call sites in both kv_store.go and sql_store.go. Instead of passing a *models.ChannelEdgeInfo, callers now pass NodeKey1Bytes and NodeKey2Bytes directly. The logic for determining which node public keys to mark as zombie-resurrectable remains structurally the same, except in the default branch the return value changed from [33]byte{}, info.NodeKey2Bytes to [33]byte{}, node1. This appears to be a functional bug (returning node1 instead of node2 when edge2 is older/missing), but it is a correctness issue in zombie channel resurrection logic rather than an exploitable security flaw. No security relevance is stated by the vendor, and no external references are provided.
Changed components
graph/db/kv_store.gograph/db/sql_store.goInspect captured patch +9 / −7
diff --git a/graph/db/kv_store.go b/graph/db/kv_store.go
index 49191d7..1abe34b 100644
--- a/graph/db/kv_store.go
+++ b/graph/db/kv_store.go
@@ -2789,7 +2789,8 @@ func (c *KVStore) delChannelEdgeUnsafe(edges, edgeIndex, chanIndex,
}
nodeKey1, nodeKey2 = makeZombiePubkeys(
- &edgeInfo, e1UpdateTime, e2UpdateTime,
+ edgeInfo.NodeKey1Bytes, edgeInfo.NodeKey2Bytes,
+ e1UpdateTime, e2UpdateTime,
)
}
@@ -2814,27 +2815,27 @@ func (c *KVStore) delChannelEdgeUnsafe(edges, edgeIndex, chanIndex,
// the channel. If the channel were to be marked zombie again, it would be
// marked with the correct lagging channel since we received an update from only
// one side.
-func makeZombiePubkeys(info *models.ChannelEdgeInfo,
- e1, e2 *time.Time) ([33]byte, [33]byte) {
+func makeZombiePubkeys(node1, node2 [33]byte, e1, e2 *time.Time) ([33]byte,
+ [33]byte) {
switch {
// If we don't have either edge policy, we'll return both pubkeys so
// that the channel can be resurrected by either party.
case e1 == nil && e2 == nil:
- return info.NodeKey1Bytes, info.NodeKey2Bytes
+ return node1, node2
// If we're missing edge1, or if both edges are present but edge1 is
// older, we'll return edge1's pubkey and a blank pubkey for edge2. This
// means that only an update from edge1 will be able to resurrect the
// channel.
case e1 == nil || (e2 != nil && e1.Before(*e2)):
- return info.NodeKey1Bytes, [33]byte{}
+ return node1, [33]byte{}
// Otherwise, we're missing edge2 or edge2 is the older side, so we
// return a blank pubkey for edge1. In this case, only an update from
// edge2 can resurect the channel.
default:
- return [33]byte{}, info.NodeKey2Bytes
+ return [33]byte{}, node1
}
}
diff --git a/graph/db/sql_store.go b/graph/db/sql_store.go
index 7a79878..c991c3b 100644
--- a/graph/db/sql_store.go
+++ b/graph/db/sql_store.go
@@ -1680,7 +1680,8 @@ func (s *SQLStore) DeleteChannelEdges(strictZombiePruning, markZombie bool,
}
nodeKey1, nodeKey2 = makeZombiePubkeys(
- info, e1UpdateTime, e2UpdateTime,
+ info.NodeKey1Bytes, info.NodeKey2Bytes,
+ e1UpdateTime, e2UpdateTime,
)
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.