[#807] node: Fix notary container invocation

Create non-notary container wrapper and
use it in load announcing since it shouldn't
be invoked as notary request.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-09-09 17:13:35 +03:00 committed by Pavel Karpy
parent 45aac7bb7f
commit 19e97e4d7c

View file

@ -41,9 +41,16 @@ const (
) )
func initContainerService(c *cfg) { func initContainerService(c *cfg) {
// container wrapper that tries to invoke notary
// requests if chain is configured so
wrap, err := wrapper.NewFromMorph(c.cfgMorph.client, c.cfgContainer.scriptHash, 0, wrapper.TryNotary()) wrap, err := wrapper.NewFromMorph(c.cfgMorph.client, c.cfgContainer.scriptHash, 0, wrapper.TryNotary())
fatalOnErr(err) fatalOnErr(err)
// container wrapper that always sends non-notary
// requests
wrapperNoNotary, err := wrapper.NewFromMorph(c.cfgMorph.client, c.cfgContainer.scriptHash, 0)
fatalOnErr(err)
cnrSrc := wrapper.AsContainerSource(wrap) cnrSrc := wrapper.AsContainerSource(wrap)
eACLFetcher := &morphEACLFetcher{ eACLFetcher := &morphEACLFetcher{
@ -76,7 +83,7 @@ func initContainerService(c *cfg) {
resultWriter := &morphLoadWriter{ resultWriter := &morphLoadWriter{
log: c.log, log: c.log,
cnrMorphClient: wrap, cnrMorphClient: wrapperNoNotary,
key: pubKey, key: pubKey,
} }