graph: update proof by ID
This commit restricts the graph CRUD interface such that one can only add a proof to a channel announcement and not update any other fields. This pattern is better suited for SQL land too.
This commit is contained in:
3 files changed
+15
-27
No files matched your search
+1
-8
@@ -1441,14 +1441,7 @@ func (b *Builder) ForAllOutgoingChannels(cb func(*models.ChannelEdgeInfo,
|
||||
func (b *Builder) AddProof(chanID lnwire.ShortChannelID,
|
||||
proof *models.ChannelAuthProof) error {
|
||||
|
||||
info, _, _, err := b.cfg.Graph.FetchChannelEdgesByID(chanID.ToUint64())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
info.AuthProof = proof
|
||||
|
||||
return b.cfg.Graph.UpdateChannelEdge(info)
|
||||
return b.cfg.Graph.AddEdgeProof(chanID, proof)
|
||||
}
|
||||
|
||||
// IsStaleNode returns true if the graph source has a node announcement for the
|
||||
|
||||
Reference in new issue
Block a user