rpc: update native contract hashes inside (c *Client) GetNativeContracts()

This commit is contained in:
Anna Shaleva 2022-02-22 15:39:42 +03:00
parent 408f6b050e
commit d77f188d10

View file

@ -271,6 +271,14 @@ func (c *Client) GetNativeContracts() ([]state.NativeContract, error) {
if err := c.performRequest("getnativecontracts", params, &resp); err != nil { if err := c.performRequest("getnativecontracts", params, &resp); err != nil {
return resp, err return resp, err
} }
// Update native contract hashes.
c.cacheLock.Lock()
for _, cs := range resp {
c.cache.nativeHashes[cs.Manifest.Name] = cs.Hash
}
c.cacheLock.Unlock()
return resp, nil return resp, nil
} }