[#316] ir/locode: Open LOCODE database in read-only mode

Inner ring Server does not modify LOCODE database (Put method), thus it is
better to open it in RO mode.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-02-09 18:21:36 +03:00 committed by Leonard Lyubich
parent 0d2440649a
commit 46d60f3d52

View file

@ -12,7 +12,9 @@ import (
func (s *Server) newLocodeValidator(cfg *viper.Viper) (netmap.NodeValidator, error) {
locodeDB := locodebolt.New(locodebolt.Prm{
Path: cfg.GetString("locode.db.path"),
})
},
locodebolt.ReadOnly(),
)
s.registerStarter(locodeDB.Open)
s.registerIOCloser(locodeDB)