hodl

package
v0.9.1-beta-rc1-branch Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const MaskNone = Mask(0)

MaskNone represents the empty Mask, in which no breakpoints are active.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct{}

Config is an empty struct disabling command line hodl flags in production.

func (*Config) Mask

func (c *Config) Mask() Mask

Mask in production always returns MaskNone.

type Flag

type Flag uint32

Flag represents a single breakpoint where an HTLC should be dropped during forwarding. Flags can be composed into a Mask to express more complex combinations.

const (
	// ExitSettle drops an incoming ADD for which we are the exit node,
	// before processing in the link.
	ExitSettle Flag = 1 << iota

	// AddIncoming drops an incoming ADD before processing if we are not
	// the exit node.
	AddIncoming

	// SettleIncoming drops an incoming SETTLE before processing if we
	// are not the exit node.
	SettleIncoming

	// FailIncoming drops an incoming FAIL before processing if we are
	// not the exit node.
	FailIncoming

	// AddOutgoing drops an outgoing ADD before it is added to the
	// in-memory commitment state of the link.
	AddOutgoing

	// SettleOutgoing drops an SETTLE before it is added to the
	// in-memory commitment state of the link.
	SettleOutgoing

	// FailOutgoing drops an outgoing FAIL before is is added to the
	// in-memory commitment state of the link.
	FailOutgoing

	// Commit drops all HTLC after any outgoing circuits have been
	// opened, but before the in-memory commitment state is persisted.
	Commit

	// BogusSettle attempts to settle back any incoming HTLC for which we
	// are the exit node with a bogus preimage.
	BogusSettle
)

func (Flag) Mask

func (f Flag) Mask() Mask

Mask returns the Mask consisting solely of this Flag.

func (Flag) String

func (f Flag) String() string

String returns a human-readable identifier for a given Flag.

func (Flag) Warning

func (f Flag) Warning() string

Warning generates a warning message to log if a particular breakpoint is triggered during execution.

type Mask

type Mask uint32

Mask is a bitvector combining multiple Flags that can be queried to see which breakpoints are active.

func MaskFromFlags

func MaskFromFlags(_ ...Flag) Mask

MaskFromFlags in production always returns MaskNone.

func (Mask) Active

func (m Mask) Active(_ Flag) bool

Active in production always returns false for all Flags.

func (Mask) String

func (m Mask) String() string

String returns the human-readable identifier for MaskNone.

Jump to

Keyboard shortcuts

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