mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-20 02:27:21 +01:00
d03047f313
In this commit a migration of the tower client db is done. The migration creates a new top-level cChanDetailsBkt bucket and for each channel found in the old cChanSummaryBkt bucket, it creates a new sub-bucket. In the subbucket, the ClientChanSummary is then stored under the cChannelSummary key. The reason for this migration is that it will be useful in future when we want to store more easily accessible data under a specific client ID.
18 lines
662 B
Go
18 lines
662 B
Go
package migration2
|
|
|
|
import "encoding/hex"
|
|
|
|
// ChannelID is a series of 32-bytes that uniquely identifies all channels
|
|
// within the network. The ChannelID is computed using the outpoint of the
|
|
// funding transaction (the txid, and output index). Given a funding output the
|
|
// ChannelID can be calculated by XOR'ing the big-endian serialization of the
|
|
// txid and the big-endian serialization of the output index, truncated to
|
|
// 2 bytes.
|
|
type ChannelID [32]byte
|
|
|
|
// String returns the string representation of the ChannelID. This is just the
|
|
// hex string encoding of the ChannelID itself.
|
|
func (c ChannelID) String() string {
|
|
return hex.EncodeToString(c[:])
|
|
}
|