wtclient: add anchor-aware session negotiation and filtering

This commit is contained in:
Conner Fromknecht committed 2020-11-25 15:05:36 -08:00
1 parent eb00e496bf
commit 781c6e5bea
2 files changed
+23 -7

No files matched your search

+12 -1
View File
@@ -112,8 +112,19 @@ var _ SessionNegotiator = (*sessionNegotiator)(nil)
// newSessionNegotiator initializes a fresh sessionNegotiator instance.
func newSessionNegotiator(cfg *NegotiatorConfig) *sessionNegotiator {
// Generate the set of features the negitator will present to the tower
// upon connection. For anchor channels, we'll conditionally signal that
// we require support for anchor channels depdening on the requested
// policy.
features := []lnwire.FeatureBit{
wtwire.AltruistSessionsRequired,
}
if cfg.Policy.IsAnchorChannel() {
features = append(features, wtwire.AnchorCommitRequired)
}
localInit := wtwire.NewInitMessage(
lnwire.NewRawFeatureVector(wtwire.AltruistSessionsRequired),
lnwire.NewRawFeatureVector(features...),
cfg.ChainHash,
)