Skip to content

Commit

Permalink
refactor: use default config for routabilityStrict
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Oct 20, 2023
1 parent f51ece6 commit 6a9f28e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cmd/celestia-appd/cmd/addrbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@ import (
"os"
"strings"

"github.com/celestiaorg/celestia-app/app"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/p2p/pex"
)

const (
// routabilityStrict is a hard-coded config value for the address book.
// See https://github.com/celestiaorg/celestia-core/blob/793ece9bbd732aec3e09018e37dc31f4bfe122d9/config/config.go#L540-L542
routabilityStrict = true
)

func addrbookCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "addrbook peers.txt addrbook.json",
Expand All @@ -34,6 +29,7 @@ func addrbookCommand() *cobra.Command {
}
lines := strings.Split(string(data), "\n")

routabilityStrict := app.DefaultConsensusConfig().P2P.AddrBookStrict
book := pex.NewAddrBook(outputFile, routabilityStrict)
for _, line := range lines {
if line == "" {
Expand Down

0 comments on commit 6a9f28e

Please sign in to comment.