[#1713] node: Add Neo RPC switch interval to the config

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-10-12 19:47:33 +03:00 committed by fyrchik
parent 0631b38da1
commit 9a0824766c
9 changed files with 34 additions and 12 deletions

View file

@ -65,7 +65,7 @@ func (c *Client) switchRPC() bool {
c.rpcActor = act
c.gasToken = gas
if !c.switchIsActive.Load() &&
if c.cfg.switchInterval != 0 && !c.switchIsActive.Load() &&
c.endpoints.list[c.endpoints.curr].Priority != c.endpoints.list[0].Priority {
c.switchIsActive.Store(true)
go c.switchToMostPrioritized()