add default keys w/public

allows default keys and future extra keys from config

maybe add some other live decoding or something too, store
hashtag channel keys in the db?
This commit is contained in:
Enot (ded) Skelly
2026-05-22 12:10:54 -07:00
parent 70026ec945
commit e561997de6
+12 -2
View File
@@ -3,13 +3,23 @@
// Future: add a DB-backed fallback that checks the channel_keys table.
package keystore
import "encoding/hex"
import (
"encoding/hex"
"maps"
)
type MapKeyStore struct {
keys map[string][]byte // channel hash hex string → key bytes
}
func NewMapKeyStore(keys map[string][]byte) *MapKeyStore {
var defaultKeys = map[string][]byte{
"11": {0x8b, 0x33, 0x87, 0xe9, 0xc5, 0xcd, 0xea, 0x6a, 0xc9, 0xe5, 0xed, 0xba, 0xa1, 0x15, 0xcd, 0x72}, // public channel
}
func NewMapKeyStore(extra map[string][]byte) *MapKeyStore {
keys := make(map[string][]byte)
maps.Copy(keys, defaultKeys)
maps.Copy(keys, extra)
return &MapKeyStore{keys}
}