From 2a6876bde2c1918f0ecee8c21ce3b75e706090b6 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 10 Mar 2018 13:02:19 -0800 Subject: [PATCH] server: ensure the replay database is stored under the graph+network namespace In this commit we modify the storage location of the sphinx replay database to be under the precise network, and not only the graph sub directory. Before this commit, due to the usage of filepath.Dir(), the db would lie under /graph/, rather than say, /graph/simnet. --- server.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server.go b/server.go index 65fb1cc05..94d444445 100644 --- a/server.go +++ b/server.go @@ -141,8 +141,9 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl, listeners := make([]net.Listener, len(listenAddrs)) for i, addr := range listenAddrs { - // Note: though brontide.NewListener uses ResolveTCPAddr, it doesn't need to call the - // general lndResolveTCP function since we are resolving a local address. + // Note: though brontide.NewListener uses ResolveTCPAddr, it + // doesn't need to call the general lndResolveTCP function + // since we are resolving a local address. listeners[i], err = brontide.NewListener(privKey, addr) if err != nil { return nil, err @@ -155,7 +156,7 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl, // Initialize the sphinx router, placing it's persistent replay log in // the same directory as the channel graph database. - graphDir := filepath.Dir(chanDB.Path()) + graphDir := chanDB.Path() sharedSecretPath := filepath.Join(graphDir, "sphinxreplay.db") sphinxRouter := sphinx.NewRouter( sharedSecretPath, privKey, activeNetParams.Params, cc.chainNotifier,