mirror of
https://github.com/fosrl/olm.git
synced 2026-03-26 12:36:47 +00:00
Handle no chainId case
This commit is contained in:
2
main.go
2
main.go
@@ -190,7 +190,7 @@ func runOlmMainWithArgs(ctx context.Context, cancel context.CancelFunc, signalCt
|
|||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
olmVersion := "version_replaceme"
|
olmVersion := "1.4.3"
|
||||||
if showVersion {
|
if showVersion {
|
||||||
fmt.Println("Olm version " + olmVersion)
|
fmt.Println("Olm version " + olmVersion)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
|||||||
16
olm/peer.go
16
olm/peer.go
@@ -42,6 +42,14 @@ func (o *Olm) handleWgPeerAdd(msg websocket.WSMessage) {
|
|||||||
delete(o.stopPeerSends, siteConfigMsg.ChainId)
|
delete(o.stopPeerSends, siteConfigMsg.ChainId)
|
||||||
}
|
}
|
||||||
o.peerSendMu.Unlock()
|
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 == "" {
|
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.
|
// pending entry so the site can be re-triggered if needed in the future.
|
||||||
delete(o.jitPendingSites, handshakeData.SiteId)
|
delete(o.jitPendingSites, handshakeData.SiteId)
|
||||||
o.peerSendMu.Unlock()
|
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
|
// Get existing peer from PeerManager
|
||||||
|
|||||||
Reference in New Issue
Block a user