resolutions

package
v0.2.13-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrChannelNotClosed is returned when we get a request for a close
	// channel report for a channel that is not present in lnd's list of
	// closed channels.
	ErrChannelNotClosed = errors.New("channel not closed, cannot create " +
		"report")

	// ErrCloseTypeNotSupported is returned when we do not yet support
	// creation of close reports for the channel type provided.
	ErrCloseTypeNotSupported = errors.New("close reports for type not " +
		"supported")
)

Functions

This section is empty.

Types

type CloseReport

type CloseReport struct {
	// ChannelPoint is the outpoint of the funding transaction.
	ChannelPoint *wire.OutPoint

	// ChannelInitiator is true if we opened the channel.
	ChannelInitiator bool

	// CloseType reflects the type of close that occurred.
	CloseType lndclient.CloseType

	// CloseTxid is the transaction ID of the channel close.
	CloseTxid string

	// OpenFee is the amount of fees we paid to open the channel in
	// satoshis. Note that this will be zero for the current protocol where
	// the initiating party pays for the channel to be opened.
	OpenFee decimal.Decimal

	// CloseFee is the amount of fees we paid to close the channel in
	// satoshis. Note that this will be zero for the current protocol where
	// the initiating party pays for the channel to be closed.
	CloseFee decimal.Decimal
}

CloseReport represents a closed channel.

func ChannelCloseReport

func ChannelCloseReport(cfg *Config, chanPoint string) (*CloseReport, error)

ChannelCloseReport returns a full report on a closed channel.

type Config

type Config struct {
	// ClosedChannels returns a list of our currently closed channels.
	ClosedChannels func() ([]lndclient.ClosedChannel, error)

	// WalletTransactions returns a list of transactions that are relevant
	// to our wallet.
	WalletTransactions func() ([]lndclient.Transaction, error)

	// GetTxDetail looks up an on chain transaction and returns the raw
	// tx result which contains a detailed set of information about the
	// transaction.
	GetTxDetail func(txHash *chainhash.Hash) (*btcjson.TxRawResult, error)

	// CalculateFees gets the total on chain fees for a transaction.
	CalculateFees func(*chainhash.Hash) (btcutil.Amount, error)
}

Config provides all the external functions and parameters required to produce reports on closed channels.

Jump to

Keyboard shortcuts

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