mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 06:05:06 +03:00
Don't crash if Yggdrasil is started with no router adapter
This commit is contained in:
parent
dd05a7f2a8
commit
a830521078
3 changed files with 14 additions and 8 deletions
|
@ -248,10 +248,10 @@ func main() {
|
|||
// Setup the Yggdrasil node itself. The node{} type includes a Core, so we
|
||||
// don't need to create this manually.
|
||||
n := node{}
|
||||
// Now that we have a working configuration, we can now actually start
|
||||
// Yggdrasil. This will start the router, switch, DHT node, TCP and UDP
|
||||
// sockets, TUN/TAP adapter and multicast discovery port.
|
||||
// Before we start the node, set the TUN/TAP to be our router adapter
|
||||
n.core.SetRouterAdapter(&n.tuntap)
|
||||
// Now start Yggdrasil - this starts the DHT, router, switch and other core
|
||||
// components needed for Yggdrasil to operate
|
||||
state, err := n.core.Start(cfg, logger)
|
||||
if err != nil {
|
||||
logger.Errorln("An error occurred during startup")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue