From ccf71af6b72deba9e539197cfc72ca1c6ff51711 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sun, 27 May 2018 23:37:57 +0100 Subject: [PATCH] Move Init from core.go to debug.go as function is only for simulator --- src/yggdrasil/core.go | 8 -------- src/yggdrasil/debug.go | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/yggdrasil/core.go b/src/yggdrasil/core.go index 9fee3743..9938266e 100644 --- a/src/yggdrasil/core.go +++ b/src/yggdrasil/core.go @@ -32,14 +32,6 @@ type Core struct { ifceExpr []*regexp.Regexp // the zone of link-local IPv6 peers must match this } -// This function is only called by the simulator to set up a node with random -// keys. It should not be used and may be removed in the future. -func (c *Core) Init() { - bpub, bpriv := newBoxKeys() - spub, spriv := newSigKeys() - c.init(bpub, bpriv, spub, spriv) -} - func (c *Core) init(bpub *boxPubKey, bpriv *boxPrivKey, spub *sigPubKey, diff --git a/src/yggdrasil/debug.go b/src/yggdrasil/debug.go index 292ca572..42d2b471 100644 --- a/src/yggdrasil/debug.go +++ b/src/yggdrasil/debug.go @@ -29,6 +29,14 @@ func StartProfiler(log *log.Logger) error { return nil } +// This function is only called by the simulator to set up a node with random +// keys. It should not be used and may be removed in the future. +func (c *Core) Init() { + bpub, bpriv := newBoxKeys() + spub, spriv := newSigKeys() + c.init(bpub, bpriv, spub, spriv) +} + //////////////////////////////////////////////////////////////////////////////// // Core