inbound

package
v0.26.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: ISC Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all package log output.

func IsLoopback

func IsLoopback(addr net.Addr) bool

IsLoopback returns whether addr identifies a loopback source.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses the specified logger for package output.

Types

type Admission

type Admission struct {
	// contains filtered or unexported fields
}

Admission tracks incomplete handshakes by normalized source prefix and bounds the CPU-intensive portion of v2 responder handshakes.

func New

func New() *Admission

New creates the production inbound admission policy.

func (*Admission) AcquireSource

func (a *Admission) AcquireSource(
	addr net.Addr, bypassSourceLimits bool,
) (func(), error)

AcquireSource reserves one incomplete-handshake slot for addr. The returned release function is safe to call more than once. Source limits are bypassed when bypassSourceLimits is set, while the global connection limit remains active at the listener boundary.

func (*Admission) BindV2

func (a *Admission) BindV2(
	remote net.Addr, bypassSourceLimits bool,
) *V2Admission

BindV2 binds the v2 admission policy to a remote address.

type V2Admission

type V2Admission struct {
	// contains filtered or unexported fields
}

V2Admission binds the server-wide v2 admission policy to a single remote address. Its first successful acquisition consumes the handshake's rate budgets. Each acquisition reserves a fresh concurrency slot for one CPU-bound responder phase.

func (*V2Admission) Acquire

func (a *V2Admission) Acquire() (func(), error)

Acquire reserves one v2 concurrency slot for the bound remote. The first successful call also consumes the global and per-source rate budgets.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL