graph/db: add version parameter to DeleteChannelEdges
Thread the gossip version through DeleteChannelEdges to enable version-aware channel deletion. The KVStore rejects non-v1 versions while SQLStore properly passes the version to the underlying queries. This prepares for v2 channel zombie handling (strict zombie pruning for v2 is marked as TODO).
This commit is contained in:
5 files changed
+43
-18
No files matched your search
@@ -1889,8 +1889,13 @@ func (c *KVStore) PruneTip() (*chainhash.Hash, uint32, error) {
|
||||
// that we require the node that failed to send the fresh update to be the one
|
||||
// that resurrects the channel from its zombie state. The markZombie bool
|
||||
// denotes whether or not to mark the channel as a zombie.
|
||||
func (c *KVStore) DeleteChannelEdges(strictZombiePruning, markZombie bool,
|
||||
chanIDs ...uint64) ([]*models.ChannelEdgeInfo, error) {
|
||||
func (c *KVStore) DeleteChannelEdges(v lnwire.GossipVersion,
|
||||
strictZombiePruning, markZombie bool, chanIDs ...uint64) (
|
||||
[]*models.ChannelEdgeInfo, error) {
|
||||
|
||||
if v != lnwire.GossipVersion1 {
|
||||
return nil, ErrVersionNotSupportedForKVDB
|
||||
}
|
||||
|
||||
// TODO(roasbeef): possibly delete from node bucket if node has no more
|
||||
// channels
|
||||
|
||||
Reference in new issue
Block a user