MCPcopy Create free account
hub / github.com/chain/Core / lookup

Method lookup

protocol/tx.go:38–49  ·  view source on GitHub ↗
(txID bc.Hash)

Source from the content-addressed store, hash-verified

36}
37
38func (c *prevalidatedTxsCache) lookup(txID bc.Hash) (err error, ok bool) {
39 c.mu.Lock()
40 v, ok := c.lru.Get(txID)
41 c.mu.Unlock()
42 if !ok {
43 return err, ok
44 }
45 if v == nil {
46 return nil, ok
47 }
48 return v.(error), ok
49}
50
51func (c *prevalidatedTxsCache) cache(txID bc.Hash, err error) {
52 c.mu.Lock()

Callers 1

ValidateTxMethod · 0.45

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected