Skip to content

Commit

Permalink
btcd: pass user agent black and white lists to server
Browse files Browse the repository at this point in the history
  • Loading branch information
cfromknecht committed Jan 10, 2018
1 parent da32186 commit 9a00b97
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions btcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"runtime"
"runtime/debug"
"runtime/pprof"
"strings"

"github.com/roasbeef/btcd/blockchain/indexers"
"github.com/roasbeef/btcd/database"
Expand Down Expand Up @@ -144,9 +145,13 @@ func btcdMain(serverChan chan<- *server) error {
return nil
}

// Parse the black and whitelists as comma separated lists.
agentBlacklist := strings.Split(cfg.AgentBlacklist, ",")
agentWhitelist := strings.Split(cfg.AgentWhitelist, ",")

// Create server and start it.
server, err := newServer(cfg.Listeners, db, activeNetParams.Params,
interrupt)
server, err := newServer(cfg.Listeners, agentBlacklist, agentWhitelist,
db, activeNetParams.Params, interrupt)
if err != nil {
// TODO: this logging could do with some beautifying.
btcdLog.Errorf("Unable to start server on %v: %v",
Expand Down

0 comments on commit 9a00b97

Please sign in to comment.