Skip to content

Commit ac6459a

Browse files
Roasbeefguggero
authored andcommitted
lndclient: expose feature bits for ListPeers resp
1 parent f4728a8 commit ac6459a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lightning_client.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,9 @@ type Peer struct {
838838

839839
// Received is the total amount we have received from this peer.
840840
Received btcutil.Amount
841+
842+
// Features is the set of the features supported by the node.
843+
Features *lnwire.FeatureVector
841844
}
842845

843846
// ChannelBalance contains information about our channel balances.
@@ -3410,6 +3413,18 @@ func (s *lightningClient) ListPeers(ctx context.Context) ([]Peer,
34103413

34113414
pingTime := time.Microsecond * time.Duration(peer.PingTime)
34123415

3416+
var featureBits []lnwire.FeatureBit
3417+
for rpcBit := range peer.Features {
3418+
featureBits = append(
3419+
featureBits, lnwire.FeatureBit(rpcBit),
3420+
)
3421+
}
3422+
3423+
peerFeatures := lnwire.NewFeatureVector(
3424+
lnwire.NewRawFeatureVector(featureBits...),
3425+
lnwire.Features,
3426+
)
3427+
34133428
peers[i] = Peer{
34143429
Pubkey: pk,
34153430
Address: peer.Address,
@@ -3419,6 +3434,7 @@ func (s *lightningClient) ListPeers(ctx context.Context) ([]Peer,
34193434
PingTime: pingTime,
34203435
Sent: btcutil.Amount(peer.SatSent),
34213436
Received: btcutil.Amount(peer.SatRecv),
3437+
Features: peerFeatures,
34223438
}
34233439
}
34243440

0 commit comments

Comments
 (0)