From ca2c6ad77fb3c849cc8c6afef54cca65c9dfe131 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 30 Nov 2021 20:31:26 +0300 Subject: [PATCH] [#979] morph/client: Return zero values from CalculateNonceAndVUB Make `CalculateNonceAndVUB` to return zero values if notary isn't enabled. Signed-off-by: Leonard Lyubich --- pkg/morph/client/notary.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/morph/client/notary.go b/pkg/morph/client/notary.go index 46d2c252..af70a210 100644 --- a/pkg/morph/client/notary.go +++ b/pkg/morph/client/notary.go @@ -875,6 +875,10 @@ func (c *Client) CalculateNonceAndVUB(hash util.Uint256) (nonce uint32, vub uint }) } + if c.notary == nil { + return 0, 0, nil + } + // TODO: cache values since some operations uses same TX as triggers nonce = binary.LittleEndian.Uint32(hash.BytesLE())