diff --git a/.gitignore b/.gitignore index de38988..e51b1c0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ vendor build nkn-tunnel main +Tunnel.framework +tunnel.aar +tunnel.jar diff --git a/tunnel.go b/tunnel.go index f600642..28f6729 100644 --- a/tunnel.go +++ b/tunnel.go @@ -57,11 +57,14 @@ func NewTunnel(numClients int, seed []byte, identifier, from, to string, session return nil, err } - tsConfigCopy := *tsConfig - tsConfigCopy.NumTunaListeners = numClients - tsConfigCopy.SessionConfig = sessionConfig + if tsConfig != nil { + tsConfigCopy := *tsConfig + tsConfigCopy.NumTunaListeners = numClients + tsConfigCopy.SessionConfig = sessionConfig + tsConfig = &tsConfigCopy + } - c, err = ts.NewTunaSessionClient(account, m, wallet, &tsConfigCopy) + c, err = ts.NewTunaSessionClient(account, m, wallet, tsConfig) if err != nil { return nil, err }