mirror of
https://github.com/lightninglabs/pool.git
synced 2026-08-13 12:33:04 +02:00
This commit bumps the compile time dependency of lnd and lndclient to the 0.16.x branch. This makes the code forward compatible but does not yet change anything with respect to the minimum required version the user needs to run.
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package chaninfo
|
|
|
|
import "github.com/lightningnetwork/lnd/keychain"
|
|
|
|
// scbEncryptionKeyLocator is the key locator used to obtain the key with which
|
|
// a channel backup is encrypted with.
|
|
var scbEncryptionKeyLocator = keychain.KeyLocator{
|
|
Family: keychain.KeyFamilyBaseEncryption,
|
|
Index: 0,
|
|
}
|
|
|
|
// scbKeyRing is a wrapper struct we'll use for decrypting retrieve channel
|
|
// backups. This keyring implementation will always return the node's channel
|
|
// backup encryption key descriptor, but it must be obtained before creation.
|
|
type scbKeyRing struct {
|
|
encryptionKey keychain.KeyDescriptor
|
|
}
|
|
|
|
// A compile-time constraint to ensure scbKeyRing satisfies keychain.KeyRing.
|
|
var _ keychain.KeyRing = (*scbKeyRing)(nil)
|
|
|
|
// DeriveNextKey retruns the node's channel backup encryption key descriptor.
|
|
func (k *scbKeyRing) DeriveNextKey(
|
|
keychain.KeyFamily) (keychain.KeyDescriptor, error) {
|
|
|
|
return k.encryptionKey, nil
|
|
}
|
|
|
|
// DeriveKey retruns the node's channel backup encryption key descriptor.
|
|
func (k *scbKeyRing) DeriveKey(
|
|
keychain.KeyLocator) (keychain.KeyDescriptor, error) {
|
|
|
|
return k.encryptionKey, nil
|
|
}
|