graph/db: treat empty channel signatures as missing
This commit improves handling of missing channel signatures in the database: - Return nil from auth proof accessors instead of empty slices so that missing signatures are stored as NULL in SQL. - Update public channel checks to require signature length > 0, which properly handles existing empty bytea values in the database. - Add regression test covering empty v1 and v2 channel signatures to prevent future issues.
This commit is contained in:
5 files changed
+85
-27
No files matched your search
@@ -3377,8 +3377,11 @@ func (c *KVStore) isPublic(tx kvdb.RTx, nodePub route.Vertex,
|
||||
}
|
||||
|
||||
// Since the edge _does_ extend to the source node, we'll also
|
||||
// need to ensure that this is a public edge.
|
||||
if info.AuthProof != nil {
|
||||
// need to ensure that this is a public edge with valid
|
||||
// signatures (not empty).
|
||||
if info.AuthProof != nil && !info.AuthProof.IsEmpty() &&
|
||||
len(info.AuthProof.BitcoinSig1()) > 0 {
|
||||
|
||||
nodeIsPublic = true
|
||||
return errDone
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user