diff --git a/lightning_client.go b/lightning_client.go index 48ccf7c..5da428f 100644 --- a/lightning_client.go +++ b/lightning_client.go @@ -825,6 +825,9 @@ type Peer struct { // Received is the total amount we have received from this peer. Received btcutil.Amount + + // Features is the set of the features supported by the node. + Features *lnwire.FeatureVector } // ChannelBalance contains information about our channel balances. @@ -3336,6 +3339,18 @@ func (s *lightningClient) ListPeers(ctx context.Context) ([]Peer, pingTime := time.Microsecond * time.Duration(peer.PingTime) + var featureBits []lnwire.FeatureBit + for rpcBit := range peer.Features { + featureBits = append( + featureBits, lnwire.FeatureBit(rpcBit), + ) + } + + peerFeatures := lnwire.NewFeatureVector( + lnwire.NewRawFeatureVector(featureBits...), + lnwire.Features, + ) + peers[i] = Peer{ Pubkey: pk, Address: peer.Address, @@ -3345,6 +3360,7 @@ func (s *lightningClient) ListPeers(ctx context.Context) ([]Peer, PingTime: pingTime, Sent: btcutil.Amount(peer.SatSent), Received: btcutil.Amount(peer.SatRecv), + Features: peerFeatures, } }