c2818a549b
This commit overhauls the current schema for storing active channels in order to support tracking+updating multiple open channels for a particular peer. Channels are now uniquely identified by an output (txid:index) rather than an arbitrary hash value. As a result, the funding transaction is no longer stored, as only the txin is required to lookup the original transaction, and to sign for new commitment states. A new bucket, nested within the bucket for a node’s Lightning ID has been created. This new bucket acts as an index to the active channels for a particular peer by storing all the active channel points as keys within the bucket. This bucket can then be scanned in a linear fashion, or queried randomly in order to retrieve channel information. The split between top-level, and channel-level keys remains the same. The primary modification comes in using the channel ID (the funding outpoint) as the key suffix for all top-level and channel-level keys.
9 lines
176 B
Go
9 lines
176 B
Go
package channeldb
|
|
|
|
import "fmt"
|
|
|
|
var (
|
|
ErrNoExists = fmt.Errorf("channel db has not yet been created")
|
|
ErrNoActiveChannels = fmt.Errorf("no active channels exist")
|
|
)
|