From b43efec59a8a687beeeee5129860879a0a2d8a0f Mon Sep 17 00:00:00 2001 From: caffix Date: Mon, 20 Mar 2023 23:23:32 -0400 Subject: [PATCH] performance improvements for passive mode --- systems/local.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/systems/local.go b/systems/local.go index 7294dadb7..f89676754 100644 --- a/systems/local.go +++ b/systems/local.go @@ -47,7 +47,11 @@ func NewLocalSystem(cfg *config.Config) (*LocalSystem, error) { return nil, errors.New("the system was unable to build the pool of trusted resolvers") } - pool, num := untrustedResolvers(cfg) + pool, num := trusted, num + if !cfg.Passive { + pool, num = untrustedResolvers(cfg) + } + if pool == nil || num == 0 { return nil, errors.New("the system was unable to build the pool of untrusted resolvers") } @@ -220,6 +224,9 @@ func (l *LocalSystem) setupGraphDBs() error { } dbs = append(dbs, cfg.GraphDBs...) + if cfg.Passive { + l.graphs = append(l.graphs, netmap.NewGraph(netmap.NewCayleyGraphMemory())) + } for _, db := range dbs { cayley := netmap.NewCayleyGraph(db.System, db.URL, db.Options) if cayley == nil {