mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 14:17:56 +01:00
lncli: Add graphical output of routing table
LIGHT-131, LIGHT-140, LIGHT-138 `lncli showroutingtable` may output routing table as image. Use graphviz for graph rendering. Add explicit version dependency for tools. Add error checking.
This commit is contained in:
14
rpcserver.go
14
rpcserver.go
@@ -512,15 +512,15 @@ func (r *rpcServer) ShowRoutingTable(ctx context.Context,
|
||||
in *lnrpc.ShowRoutingTableRequest) (*lnrpc.ShowRoutingTableResponse, error) {
|
||||
rpcsLog.Debugf("[ShowRoutingTable]")
|
||||
rtCopy := r.server.routingMgr.GetRTCopy()
|
||||
channels := make([]*lnrpc.RTChannel, 0)
|
||||
channels := make([]*lnrpc.RoutingTableLink, 0)
|
||||
for _, channel := range rtCopy.AllChannels() {
|
||||
channels = append(channels,
|
||||
&lnrpc.RTChannel{
|
||||
Id1: channel.Id1.String(),
|
||||
Id2: channel.Id2.String(),
|
||||
EdgeID: channel.EdgeID.String(),
|
||||
Capacity: channel.Info.Capacity(),
|
||||
Weight: channel.Info.Weight(),
|
||||
&lnrpc.RoutingTableLink{
|
||||
Id1: channel.Id1.String(),
|
||||
Id2: channel.Id2.String(),
|
||||
Outpoint: channel.EdgeID.String(),
|
||||
Capacity: channel.Info.Capacity(),
|
||||
Weight: channel.Info.Weight(),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user