forked from TrueCloudLab/neoneo-go
rpc: update native contract hashes inside (c *Client) GetNativeContracts()
This commit is contained in:
parent
408f6b050e
commit
d77f188d10
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue