Skip to content

Commit 5f58293

Browse files
Roasbeefguggero
authored andcommitted
lndclient: expose feature bits for ListPeers resp
1 parent 51a028b commit 5f58293

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
@@ -845,6 +845,9 @@ type Peer struct {
845845

846846
// Received is the total amount we have received from this peer.
847847
Received btcutil.Amount
848+
849+
// Features is the set of the features supported by the node.
850+
Features *lnwire.FeatureVector
848851
}
849852

850853
// ChannelBalance contains information about our channel balances.
@@ -3417,6 +3420,18 @@ func (s *lightningClient) ListPeers(ctx context.Context) ([]Peer,
34173420

34183421
pingTime := time.Microsecond * time.Duration(peer.PingTime)
34193422

3423+
var featureBits []lnwire.FeatureBit
3424+
for rpcBit := range peer.Features {
3425+
featureBits = append(
3426+
featureBits, lnwire.FeatureBit(rpcBit),
3427+
)
3428+
}
3429+
3430+
peerFeatures := lnwire.NewFeatureVector(
3431+
lnwire.NewRawFeatureVector(featureBits...),
3432+
lnwire.Features,
3433+
)
3434+
34203435
peers[i] = Peer{
34213436
Pubkey: pk,
34223437
Address: peer.Address,
@@ -3426,6 +3441,7 @@ func (s *lightningClient) ListPeers(ctx context.Context) ([]Peer,
34263441
PingTime: pingTime,
34273442
Sent: btcutil.Amount(peer.SatSent),
34283443
Received: btcutil.Amount(peer.SatRecv),
3444+
Features: peerFeatures,
34293445
}
34303446
}
34313447

0 commit comments

Comments
 (0)