forked from TrueCloudLab/neoneo-go
native: store cache during Oracle contract creation
`Initialize` is not called during restore from dump.
This commit is contained in:
parent
e550608ecd
commit
05118e96f4
1 changed files with 3 additions and 2 deletions
|
@ -130,6 +130,9 @@ func newOracle() *Oracle {
|
||||||
md = newMethodAndPrice(getOnPersistWrapper(pp), 0, smartcontract.AllowModifyStates)
|
md = newMethodAndPrice(getOnPersistWrapper(pp), 0, smartcontract.AllowModifyStates)
|
||||||
o.AddMethod(md, desc, false)
|
o.AddMethod(md, desc, false)
|
||||||
|
|
||||||
|
o.nodes.Store(keys.PublicKeys(nil))
|
||||||
|
o.nodesChanged.Store(false)
|
||||||
|
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,8 +202,6 @@ func (o *Oracle) Initialize(ic *interop.Context) error {
|
||||||
if err := ic.DAO.PutStorageItem(o.ContractID, prefixNodeList, si); err != nil {
|
if err := ic.DAO.PutStorageItem(o.ContractID, prefixNodeList, si); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
o.nodes.Store(keys.PublicKeys(nil))
|
|
||||||
o.nodesChanged.Store(false)
|
|
||||||
si = &state.StorageItem{Value: make([]byte, 8)} // uint64(0) LE
|
si = &state.StorageItem{Value: make([]byte, 8)} // uint64(0) LE
|
||||||
return ic.DAO.PutStorageItem(o.ContractID, prefixRequestID, si)
|
return ic.DAO.PutStorageItem(o.ContractID, prefixRequestID, si)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue