hodl

package
v0.4.2-beta Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DebugBuild = false

DebugBuild signals that this is a production build.

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 {
	ExitSettle bool `` /* 132-byte string literal not displayed */

	AddIncoming bool `long:"add-incoming" description:"Instructs the node to drop incoming ADDs before processing them in the incoming link"`

	SettleIncoming bool `long:"settle-incoming" description:"Instructs the node to drop incoming SETTLEs before processing them in the incoming link"`

	FailIncoming bool `long:"fail-incoming" description:"Instructs the node to drop incoming FAILs before processing them in the incoming link"`

	AddOutgoing bool `long:"add-outgoing" description:"Instructs the node to drop outgoing ADDs before applying them to the channel state"`

	SettleOutgoing bool `long:"settle-outgoing" description:"Instructs the node to drop outgoing SETTLEs before applying them to the channel state"`

	FailOutgoing bool `long:"fail-outgoing" description:"Instructs the node to drop outgoing FAILs before applying them to the channel state"`

	Commit bool `` /* 164-byte string literal not displayed */

	BogusSettle bool `long:"bogus-settle" description:"Instructs the node to settle back any incoming HTLC with a bogus preimage"`
}

Config is a struct enumerating the possible command line flags that are used to activate specific hodl modes.

NOTE: THESE FLAGS ARE INTENDED FOR TESTING PURPOSES ONLY. ACTIVATING THESE FLAGS IN PRODUCTION WILL VIOLATE CRITICAL ASSUMPTIONS MADE BY THIS SOFTWARE.

func (*Config) Mask

func (c *Config) Mask() Mask

Mask extracts the flags specified in the configuration, composing a Mask from the active flags.

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