Co-authored-by: Adam Tucker <adam@osmosis.team> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
parent
c4dc83d1a8
commit
f595146abd
@ -9,6 +9,7 @@ import (
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime/pprof"
|
||||
"strings"
|
||||
"time"
|
||||
@ -780,6 +781,17 @@ func testnetify[T types.Application](ctx *Context, testnetAppCreator types.AppCr
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Regenerate addrbook.json to prevent peers on old network from causing error logs.
|
||||
addrBookPath := filepath.Join(config.RootDir, "config", "addrbook.json")
|
||||
if err := os.Remove(addrBookPath); err != nil && !os.IsNotExist(err) {
|
||||
return nil, fmt.Errorf("failed to remove existing addrbook.json: %w", err)
|
||||
}
|
||||
|
||||
emptyAddrBook := []byte("{}")
|
||||
if err := os.WriteFile(addrBookPath, emptyAddrBook, 0o600); err != nil {
|
||||
return nil, fmt.Errorf("failed to create empty addrbook.json: %w", err)
|
||||
}
|
||||
|
||||
// Load the comet genesis doc provider.
|
||||
genDocProvider := node.DefaultGenesisDocProviderFunc(config)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user