btcd/internal/inbound/log.go
Boris Nagaev 6c056ec471
server: centralize inbound handshake admission
In this commit, we introduce a server-wide admission policy for
incomplete inbound handshakes and the CPU-bound portion of v2 responder
setup. Source accounting uses normalized IPv4 and IPv6 prefixes, while
global, per-source, and concurrent v2 budgets remain independent and
bounded.

Peer construction passes the policy through a small interface only for
inbound v2 responders. Handshake slots release on verack or disconnect,
and the connection manager reserves MaxPeers capacity for automatic
outbound peers.
2026-07-18 00:17:55 -05:00

26 lines
634 B
Go

// Copyright (c) 2026 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package inbound
import "github.com/btcsuite/btclog"
// log is initialized with no output filters. This means the package will not
// perform any logging until the caller requests it.
var log btclog.Logger
// The default amount of logging is none.
func init() {
DisableLog()
}
// DisableLog disables all package log output.
func DisableLog() {
log = btclog.Disabled
}
// UseLogger uses the specified logger for package output.
func UseLogger(logger btclog.Logger) {
log = logger
}