From 05b53916143163a2c783e257803a3fed131003cd Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 19 Jan 2023 16:59:49 -0800 Subject: [PATCH] channeldb: add new db type for taproot channels --- channeldb/channel.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/channeldb/channel.go b/channeldb/channel.go index 59eb357c0..e624876b7 100644 --- a/channeldb/channel.go +++ b/channeldb/channel.go @@ -303,6 +303,10 @@ const ( // ScidAliasFeatureBit indicates that the scid-alias feature bit was // negotiated during the lifetime of this channel. ScidAliasFeatureBit ChannelType = 1 << 9 + + // SimpleTaprootFeatureBit indicates that the simple-taproot-channels + // feature bit was negotiated during the lifetime of the channel. + SimpleTaprootFeatureBit ChannelType = 1 << 10 ) // IsSingleFunder returns true if the channel type if one of the known single @@ -368,6 +372,11 @@ func (c ChannelType) HasScidAliasFeature() bool { return c&ScidAliasFeatureBit == ScidAliasFeatureBit } +// IsTaproot returns true if the channel is using taproot features. +func (c ChannelType) IsTaproot() bool { + return c&SimpleTaprootFeatureBit == SimpleTaprootFeatureBit +} + // ChannelConstraints represents a set of constraints meant to allow a node to // limit their exposure, enact flow control and ensure that all HTLCs are // economically relevant. This struct will be mirrored for both sides of the