From e320330d29cd7c3383129bf1ed2fb7e46f588a80 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Wed, 2 Nov 2016 16:17:50 -0500 Subject: [PATCH] multi: Remove unused code found by deadcode. --- addrmgr/addrmanager.go | 4 +--- blockchain/log.go | 15 +-------------- blockmanager.go | 2 -- config.go | 1 - log.go | 22 ---------------------- 5 files changed, 2 insertions(+), 42 deletions(-) diff --git a/addrmgr/addrmanager.go b/addrmgr/addrmanager.go index f6d331be..16c66f71 100644 --- a/addrmgr/addrmanager.go +++ b/addrmgr/addrmanager.go @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2014 The btcsuite developers +// Copyright (c) 2013-2016 The btcsuite developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -96,8 +96,6 @@ const ( // address manager will claim to need more addresses. needAddressThreshold = 1000 - newAddressBufferSize = 50 - // dumpAddressInterval is the interval used to dump the address // cache to disk for future use. dumpAddressInterval = time.Minute * 10 diff --git a/blockchain/log.go b/blockchain/log.go index c80e4d9e..6233fc9b 100644 --- a/blockchain/log.go +++ b/blockchain/log.go @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2014 The btcsuite developers +// Copyright (c) 2013-2016 The btcsuite developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -56,16 +56,3 @@ func SetLogWriter(w io.Writer, level string) error { UseLogger(l) return nil } - -// LogClosure is a closure that can be printed with %v to be used to -// generate expensive-to-create data for a detailed log level and avoid doing -// the work if the data isn't printed. -type logClosure func() string - -func (c logClosure) String() string { - return c() -} - -func newLogClosure(c func() string) logClosure { - return logClosure(c) -} diff --git a/blockmanager.go b/blockmanager.go index 7cac6b19..d74fd975 100644 --- a/blockmanager.go +++ b/blockmanager.go @@ -23,8 +23,6 @@ import ( ) const ( - chanBufferSize = 50 - // minInFlightBlocks is the minimum number of blocks that should be // in the request queue for headers-first mode before requesting // more. diff --git a/config.go b/config.go index a0ff80dc..f4dd0ef7 100644 --- a/config.go +++ b/config.go @@ -42,7 +42,6 @@ const ( defaultMaxRPCClients = 10 defaultMaxRPCWebsockets = 25 defaultMaxRPCConcurrentReqs = 20 - defaultVerifyEnabled = false defaultDbType = "ffldb" defaultFreeTxRelayLimit = 15.0 defaultBlockMinSize = 0 diff --git a/log.go b/log.go index ae58547d..a4d403e6 100644 --- a/log.go +++ b/log.go @@ -22,12 +22,6 @@ import ( "github.com/btcsuite/seelog" ) -const ( - // maxRejectReasonLen is the maximum length of a sanitized reject reason - // that will be logged. - maxRejectReasonLen = 250 -) - // Loggers per subsystem. Note that backendLog is a seelog logger that all of // the subsystem loggers route their messages to. When adding new subsystems, // add a reference here, to the subsystemLoggers map, and the useLogger @@ -70,22 +64,6 @@ var subsystemLoggers = map[string]btclog.Logger{ "TXMP": txmpLog, } -// logClosure is used to provide a closure over expensive logging operations -// so don't have to be performed when the logging level doesn't warrant it. -type logClosure func() string - -// String invokes the underlying function and returns the result. -func (c logClosure) String() string { - return c() -} - -// newLogClosure returns a new closure over a function that returns a string -// which itself provides a Stringer interface so that it can be used with the -// logging system. -func newLogClosure(c func() string) logClosure { - return logClosure(c) -} - // useLogger updates the logger references for subsystemID to logger. Invalid // subsystems are ignored. func useLogger(subsystemID string, logger btclog.Logger) {