This makes the mempool an internal package such that it will no longer be an exported module. The only place its functionality is really needed is for the internal implementation of dcrd itself and thus having an unnecessary exported module significantly increases the maintenance burden. This is part of the overall effort to reduce the total number of modules and eventually get to the point it will be possible to follow semver for the root module. It is worth noting that there are a few constants, which will be listed below, that were exported from this module that callers might have previously relied upon. However, due to previous discussions about the goal of removing the module, a code search has revealed that there are no known callers that still rely on them. The aforementioned constants are: - MaxStandardTxSize - DefaultMinRelayTxFee - BaseStandardVerifyFlags Overview of the major changes: - Move the following files from mempool -> internal/mempool: - README.md - doc.go - error.go - log.go - mempool.go - mempool_test.go - policy.go - policy_test.go - Remove mempool/go.mod and mempool/go.sum - Make the README.md and doc.go files match the new reality - Update all import paths in the repository accordingly - Remove the dependency from the root go.mod - Run go mod tidy on all modules
33 lines
891 B
Go
33 lines
891 B
Go
// Copyright (c) 2013-2016 The btcsuite developers
|
|
// Copyright (c) 2016-2019 The Decred developers
|
|
// Use of this source code is governed by an ISC
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package mempool
|
|
|
|
import (
|
|
"github.com/decred/slog"
|
|
)
|
|
|
|
// log is a logger that is initialized with no output filters. This
|
|
// means the package will not perform any logging by default until the caller
|
|
// requests it.
|
|
// The default amount of logging is none.
|
|
var log = slog.Disabled
|
|
|
|
// UseLogger uses a specified Logger to output package logging info.
|
|
// This should be used in preference to SetLogWriter if the caller is also
|
|
// using slog.
|
|
func UseLogger(logger slog.Logger) {
|
|
log = logger
|
|
}
|
|
|
|
// pickNoun returns the singular or plural form of a noun depending
|
|
// on the count n.
|
|
func pickNoun(n int, singular, plural string) string {
|
|
if n == 1 {
|
|
return singular
|
|
}
|
|
return plural
|
|
}
|