Handle no chainId case

This commit is contained in:
Owen
2026-03-16 14:31:16 -07:00
parent 4bc0508c7d
commit 703c606af5
2 changed files with 20 additions and 4 deletions

View File

@@ -190,7 +190,7 @@ func runOlmMainWithArgs(ctx context.Context, cancel context.CancelFunc, signalCt
os.Exit(0)
}
olmVersion := "version_replaceme"
olmVersion := "1.4.3"
if showVersion {
fmt.Println("Olm version " + olmVersion)
os.Exit(0)

View File

@@ -42,6 +42,14 @@ func (o *Olm) handleWgPeerAdd(msg websocket.WSMessage) {
delete(o.stopPeerSends, siteConfigMsg.ChainId)
}
o.peerSendMu.Unlock()
} else {
// stop all of the stopPeerSends
o.peerSendMu.Lock()
for _, stop := range o.stopPeerSends {
stop()
}
o.stopPeerSends = make(map[string]func())
o.peerSendMu.Unlock()
}
if siteConfigMsg.PublicKey == "" {
@@ -283,6 +291,14 @@ func (o *Olm) handleWgPeerHolepunchAddSite(msg websocket.WSMessage) {
// pending entry so the site can be re-triggered if needed in the future.
delete(o.jitPendingSites, handshakeData.SiteId)
o.peerSendMu.Unlock()
} else {
// Stop all of the stopPeerInits
o.peerSendMu.Lock()
for _, stop := range o.stopPeerInits {
stop()
}
o.stopPeerInits = make(map[string]func())
o.peerSendMu.Unlock()
}
// Get existing peer from PeerManager