From 088c9c5ba4de44517c2a2b300797e7999ee43ae7 Mon Sep 17 00:00:00 2001 From: Akilan Selvacoumar Date: Thu, 22 Jul 2021 14:08:15 +0400 Subject: [PATCH] changed back to default print when using IP tables --- cmd/action.go | 21 +++++++++++---------- p2p/iptable.go | 4 ++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/cmd/action.go b/cmd/action.go index 8f6765a..429566e 100644 --- a/cmd/action.go +++ b/cmd/action.go @@ -25,22 +25,23 @@ var CliAction = func(ctx *cli.Context) error { } // Reads from ip table and passes it // on to struct print function - Servers, err := p2p.ReadIpTable() - if err != nil { - return err - } - client.PrettyPrint(Servers) + //Servers, err := p2p.ReadIpTable() + //if err != nil { + // return err + //} + //client.PrettyPrint(Servers) + p2p.PrintIpTable() } // Displays the IP table if ServerList { // Reads from ip table and passes it // on to struct print function - Servers, err := p2p.ReadIpTable() - if err != nil { - return err - } - client.PrettyPrint(Servers) + //Servers, err := p2p.ReadIpTable() + //if err != nil { + // return err + //} + p2p.PrintIpTable() } // Add provided IP to the IP table diff --git a/p2p/iptable.go b/p2p/iptable.go index 9cb3159..f3eb69a 100644 --- a/p2p/iptable.go +++ b/p2p/iptable.go @@ -118,9 +118,9 @@ func PrintIpTable() error { } for i := 0; i < len(table.IpAddress); i++ { - fmt.Printf("\nIP Address: %s\nIPV6: %s\nLatency: %s\n-----------" + + fmt.Printf("\nIP Address: %s\nIPV6: %s\nLatency: %s\nServerPort: %s\n-----------" + "-----------------\n",table.IpAddress[i].Ipv4,table.IpAddress[i].Ipv6, - table.IpAddress[i].Latency) + table.IpAddress[i].Latency, table.IpAddress[i].ServerPort) } return nil