[#1793] node: Serve NetmapService.NetmapSnapshot RPC

There is no more need to serve the same request on Control API.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-09-17 16:37:01 +04:00 committed by fyrchik
parent 59de20fbba
commit 485a5418d2
33 changed files with 653 additions and 1238 deletions

View file

@ -6,6 +6,7 @@ import (
"net"
"path/filepath"
"sync"
atomicstd "sync/atomic"
"time"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
@ -134,6 +135,13 @@ type cfg struct {
persistate *state.PersistentStorage
netMapSource netmapCore.Source
// current network map
netMap atomicstd.Value // type netmap.NetMap
}
func (c *cfg) ProcessCurrentNetMap(f func(netmap.NetMap)) {
f(c.netMap.Load().(netmap.NetMap))
}
type cfgGRPC struct {