peer+lnpeer: add new methods to expose local+global features for lnpeer interface

This commit is contained in:
Olaoluwa Osuntokun committed 2019-09-25 18:26:01 -07:00
1 parent a58cfa65ff
commit 3f8526a0ca
7 files changed
+59 -1

No files matched your search

+18
View File
@@ -2410,6 +2410,24 @@ func (p *peer) handleInitMsg(msg *lnwire.Init) error {
return nil
}
// LocalGlobalFeatures returns the set of global features that has been
// advertised by the local node. This allows sub-systems that use this
// interface to gate their behavior off the set of negotiated feature bits.
//
// NOTE: Part of the lnpeer.Peer interface.
func (p *peer) LocalGlobalFeatures() *lnwire.FeatureVector {
return p.server.globalFeatures
}
// RemoteGlobalFeatures returns the set of global features that has been
// advertised by the remote node. This allows sub-systems that use this
// interface to gate their behavior off the set of negotiated feature bits.
//
// NOTE: Part of the lnpeer.Peer interface.
func (p *peer) RemoteGlobalFeatures() *lnwire.FeatureVector {
return p.remoteGlobalFeatures
}
// sendInitMsg sends init message to remote peer which contains our currently
// supported local and global features.
func (p *peer) sendInitMsg() error {