peer: rename theirLocalFeatures+theirGlobal features to remote prefix

This commit is contained in:
Olaoluwa Osuntokun 2017-10-18 15:14:22 -07:00
parent 46d4f7216e
commit f6f983a13b
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

21
peer.go

@ -147,13 +147,14 @@ type peer struct {
server *server server *server
// theirLocalFeatures is the local feature vector received from the peer
// during the connection handshake.
theirLocalFeatures *lnwire.FeatureVector
// theirGlobalFeatures is the global feature vector received from the peer // remoteLocalFeatures is the local feature vector received from the
// during the connection handshake. // peer during the connection handshake.
theirGlobalFeatures *lnwire.FeatureVector remoteLocalFeatures *lnwire.FeatureVector
// remoteGlobalFeatures is the global feature vector received from the
// peer during the connection handshake.
remoteGlobalFeatures *lnwire.FeatureVector
queueQuit chan struct{} queueQuit chan struct{}
quit chan struct{} quit chan struct{}
@ -1937,12 +1938,12 @@ func (p *peer) WipeChannel(channel *lnwallet.LightningChannel) error {
// handleInitMsg handles the incoming init message which contains global and // handleInitMsg handles the incoming init message which contains global and
// local features vectors. If feature vectors are incompatible then disconnect. // local features vectors. If feature vectors are incompatible then disconnect.
func (p *peer) handleInitMsg(msg *lnwire.Init) error { func (p *peer) handleInitMsg(msg *lnwire.Init) error {
p.theirLocalFeatures = lnwire.NewFeatureVector(msg.LocalFeatures, p.remoteLocalFeatures = lnwire.NewFeatureVector(msg.LocalFeatures,
lnwire.LocalFeatures) lnwire.LocalFeatures)
p.theirGlobalFeatures = lnwire.NewFeatureVector(msg.GlobalFeatures, p.remoteGlobalFeatures = lnwire.NewFeatureVector(msg.GlobalFeatures,
lnwire.GlobalFeatures) lnwire.GlobalFeatures)
unknownLocalFeatures := p.theirLocalFeatures.UnknownRequiredFeatures() unknownLocalFeatures := p.remoteLocalFeatures.UnknownRequiredFeatures()
if len(unknownLocalFeatures) > 0 { if len(unknownLocalFeatures) > 0 {
err := errors.Errorf("Peer set unknown local feature bits: %v", err := errors.Errorf("Peer set unknown local feature bits: %v",
unknownLocalFeatures) unknownLocalFeatures)
@ -1950,7 +1951,7 @@ func (p *peer) handleInitMsg(msg *lnwire.Init) error {
return err return err
} }
unknownGlobalFeatures := p.theirGlobalFeatures.UnknownRequiredFeatures() unknownGlobalFeatures := p.remoteGlobalFeatures.UnknownRequiredFeatures()
if len(unknownGlobalFeatures) > 0 { if len(unknownGlobalFeatures) > 0 {
err := errors.Errorf("Peer set unknown global feature bits: %v", err := errors.Errorf("Peer set unknown global feature bits: %v",
unknownGlobalFeatures) unknownGlobalFeatures)