lnd.xprv/peer
Olaoluwa Osuntokun 403d37f426
peer: ensure consistent local+global feature bits when downgrading
In this commit, we fix an issue that would cause peers running lnd 0.12
to not be able to connect to existing peers due to a feature bit
compatibility issue. In a recent PR we started to downgrade our required
feature bit for static key from required to optional, if we had a legacy
(non-tweakless) open with the peer then we would unset the required bit
and set the optional bit to ensure we could still connect to them.

The change implementing this new version of downgrade failed _also_
unset the bit (the required bit) in the "legacy global" feature bit
section. This caused the `RawFeatureVector.Merge` method to fail as we
would have the required bit set in the `GlobalFeatures` section, but the
optional bit set in the `Features` section. The `Merge` method ensures
that a required and optional bit can't be set in two different locations
for the same feature.

This PR fixes this issue by also unsetting the bit in the
`GlobalFeatures` field in the init message.

Fixes #4871
2020-12-17 17:04:15 -08:00
..
brontide_test.go peer: ensure consistent local+global feature bits when downgrading 2020-12-17 17:04:15 -08:00
brontide.go peer: ensure consistent local+global feature bits when downgrading 2020-12-17 17:04:15 -08:00
interfaces.go server.go + peer: use MessageConn interface instead of brontide.Conn 2020-09-25 12:05:36 -04:00
log.go multi: remove peer.go, change all references to point to peer pkg 2020-07-06 19:16:07 -04:00
test_utils.go peer/test: add test for static key downgrade for legacy channels 2020-12-09 16:31:02 +02:00