[#733] neofs-adm: read contracts on start

Fail early and reduce disk operations when reading from archive.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-10-25 16:19:56 +03:00 committed by Alex Vanin
parent 0b6350d463
commit 088c894f44
6 changed files with 105 additions and 107 deletions

View file

@ -132,10 +132,7 @@ func (c *initializeContext) multiSign(tx *transaction.Transaction, accType strin
func (c *initializeContext) transferGASToProxy() error {
gasHash := c.nativeHash(nativenames.Gas)
proxyCs, err := c.readContract(proxyContract)
if err != nil {
return err
}
proxyCs := c.getContract(proxyContract)
bal, err := c.Client.NEP17BalanceOf(gasHash, proxyCs.Hash)
if err != nil || bal > 0 {