channeldb+lnwallet: define zero-fee channel type

This commit is contained in:
Johan T. Halseth committed 2020-12-15 10:13:07 +01:00
1 parent abefa93065
commit d5cd9861d2
2 files changed
+22

No files matched your search

+10
View File
@@ -244,6 +244,10 @@ const (
// that only the responder can decide to cooperatively close the
// channel.
FrozenBit ChannelType = 1 << 4
// ZeroHtlcTxFeeBit indicates that the channel should use zero-fee
// second-level HTLC transactions.
ZeroHtlcTxFeeBit ChannelType = 1 << 5
)
// IsSingleFunder returns true if the channel type if one of the known single
@@ -275,6 +279,12 @@ func (c ChannelType) HasAnchors() bool {
return c&AnchorOutputsBit == AnchorOutputsBit
}
// ZeroHtlcTxFee returns true if this channel type uses second-level HTLC
// transactions signed with zero-fee.
func (c ChannelType) ZeroHtlcTxFee() bool {
return c&ZeroHtlcTxFeeBit == ZeroHtlcTxFeeBit
}
// IsFrozen returns true if the channel is considered to be "frozen". A frozen
// channel means that only the responder can initiate a cooperative channel
// closure.