mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Fix panic, fix lint error
This commit is contained in:
parent
3c1d874ebd
commit
a2e1a4a485
|
|
@ -49,7 +49,7 @@ import (
|
|||
|
||||
func createKeyDB(
|
||||
base *P2PDendrite,
|
||||
db gomatrixserverlib.KeyDatabase,
|
||||
db *gomatrixserverlib.KeyRing,
|
||||
) {
|
||||
mdns := mDNSListener{
|
||||
host: base.LibP2P,
|
||||
|
|
@ -168,11 +168,9 @@ func main() {
|
|||
panic("failed to create new public rooms provider: " + err.Error())
|
||||
}
|
||||
|
||||
/*
|
||||
createKeyDB(
|
||||
base, keyRing,
|
||||
)
|
||||
*/
|
||||
createKeyDB(
|
||||
base, keyRing,
|
||||
)
|
||||
|
||||
monolith := setup.Monolith{
|
||||
Config: base.Base.Cfg,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import (
|
|||
)
|
||||
|
||||
type mDNSListener struct {
|
||||
keydb gomatrixserverlib.KeyDatabase
|
||||
keydb *gomatrixserverlib.KeyRing
|
||||
host host.Host
|
||||
}
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ func (n *mDNSListener) HandlePeerFound(p peer.AddrInfo) {
|
|||
}
|
||||
if pubkey, err := p.ID.ExtractPublicKey(); err == nil {
|
||||
raw, _ := pubkey.Raw()
|
||||
if err := n.keydb.StoreKeys(
|
||||
if err := n.keydb.KeyDatabase.StoreKeys(
|
||||
context.Background(),
|
||||
map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult{
|
||||
{
|
||||
|
|
|
|||
|
|
@ -67,7 +67,9 @@ type serverSigningKeyStatements struct {
|
|||
}
|
||||
|
||||
func NewSQLiteServerSigningKeysTable(db *sql.DB) (s *serverSigningKeyStatements, err error) {
|
||||
s = &serverSigningKeyStatements{}
|
||||
s = &serverSigningKeyStatements{
|
||||
db: db,
|
||||
}
|
||||
_, err = db.Exec(serverSigningKeysSchema)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in a new issue