native: make management compatible with C# node 3.5.0
It doesn't store id->hash mappings for native contracts. We need blockchain's GetContractScriptHash to serve both anyway, so it was changed a bit. The only other direct user of native.GetContractScriptHash is the VM CLI, but I doubt anyone will use it for native contracts (they have ~zero VM code anyway).
This commit is contained in:
parent
90a85259a8
commit
236e633ee4
5 changed files with 17 additions and 4 deletions
|
@ -688,8 +688,10 @@ func putContractState(d *dao.Simple, cs *state.Contract, updateCache bool) error
|
|||
if cs.UpdateCounter != 0 { // Update.
|
||||
return nil
|
||||
}
|
||||
key = putHashKey(key, cs.ID)
|
||||
d.PutStorageItem(ManagementContractID, key, cs.Hash.BytesBE())
|
||||
if cs.ID > 0 {
|
||||
key = putHashKey(key, cs.ID)
|
||||
d.PutStorageItem(ManagementContractID, key, cs.Hash.BytesBE())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue