MCPcopy Create free account
hub / github.com/copernet/copernicus / AddScript

Method AddScript

model/wallet/scriptstore.go:21–28  ·  view source on GitHub ↗
(s *script.Script)

Source from the content-addressed store, hash-verified

19}
20
21func (ss *ScriptStore) AddScript(s *script.Script) {
22 scriptHash := util.Hash160(s.Bytes())
23
24 ss.Lock()
25 defer ss.Unlock()
26
27 ss.scripts[string(scriptHash)] = s
28}
29
30func (ss *ScriptStore) GetScript(scriptHash []byte) *script.Script {
31 ss.RLock()

Callers

nothing calls this directly

Calls 4

LockMethod · 0.80
UnlockMethod · 0.80
Hash160Method · 0.45
BytesMethod · 0.45

Tested by

no test coverage detected