graph/db: use batch fetching for DeleteChannelEdges

This commit is contained in:
Elle Mouton
2025-08-05 14:04:35 +02:00
parent ebe6a8af9f
commit 556af8e221
2 changed files with 156 additions and 64 deletions

View File

@@ -71,3 +71,37 @@ func (r GetChannelsByPolicyLastUpdateRangeRow) Node1() GraphNode {
func (r GetChannelsByPolicyLastUpdateRangeRow) Node2() GraphNode {
return r.GraphNode_2
}
// ChannelAndNodeIDs is an interface that provides access to a channel and its
// two node public keys.
type ChannelAndNodeIDs interface {
// Channel returns the GraphChannel associated with this interface.
Channel() GraphChannel
// Node1Pub returns the public key of the first node as a byte slice.
Node1Pub() []byte
// Node2Pub returns the public key of the second node as a byte slice.
Node2Pub() []byte
}
// Channel returns the GraphChannel associated with this interface.
//
// NOTE: This method is part of the ChannelAndNodeIDs interface.
func (r GetChannelsBySCIDWithPoliciesRow) Channel() GraphChannel {
return r.GraphChannel
}
// Node1Pub returns the public key of the first node as a byte slice.
//
// NOTE: This method is part of the ChannelAndNodeIDs interface.
func (r GetChannelsBySCIDWithPoliciesRow) Node1Pub() []byte {
return r.GraphNode.PubKey
}
// Node2Pub returns the public key of the second node as a byte slice.
//
// NOTE: This method is part of the ChannelAndNodeIDs interface.
func (r GetChannelsBySCIDWithPoliciesRow) Node2Pub() []byte {
return r.GraphNode_2.PubKey
}