migration27

package
v0.15.5-beta Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNoChanInfoFound is returned when a particular channel does not
	// have any channels state.
	ErrNoChanInfoFound = fmt.Errorf("no chan info found")
)

Functions

func FetchChanInfo

func FetchChanInfo(chanBucket kvdb.RBucket, c *OpenChannel, legacy bool) error

FetchChanInfo deserializes the channel info based on the legacy boolean.

func MigrateHistoricalBalances

func MigrateHistoricalBalances(tx kvdb.RwTx) error

MigrateHistoricalBalances patches the two new fields, `InitialLocalBalance` and `InitialRemoteBalance`, for all the open channels saved in historical channel bucket. Unlike migration 25, it will only read the old channel info first and then patch the new tlv records with empty values. For historical channels, we previously didn't save the initial balances anywhere and since it's corresponding open channel bucket is deleted after closure, we have lost that balance info.

func PutChanInfo

func PutChanInfo(chanBucket kvdb.RwBucket, c *OpenChannel, legacy bool) error

PutChanInfo serializes the channel info based on the legacy boolean.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type OpenChannel

type OpenChannel struct {
	mig26.OpenChannel
}

OpenChannel embeds a mig26.OpenChannel with the extra update-to-date serialization and deserialization methods.

NOTE: doesn't have the Packager field as it's not used in current migration.

Jump to

Keyboard shortcuts

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