MCPcopy Create free account
hub / github.com/LUX-Core/lux / codeSize

Method codeSize

src/cpp-ethereum/libethereum/State.cpp:454–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454size_t State::codeSize(Address const& _a) const
455{
456 if (Account const* a = account(_a))
457 {
458 if (a->hasNewCode())
459 return a->code().size();
460 auto& codeSizeCache = CodeSizeCache::instance();
461 h256 codeHash = a->codeHash();
462 if (codeSizeCache.contains(codeHash))
463 return codeSizeCache.get(codeHash);
464 else
465 {
466 size_t size = code(_a).size();
467 codeSizeCache.store(codeHash, size);
468 return size;
469 }
470 }
471 else
472 return 0;
473}
474
475size_t State::savepoint() const
476{

Callers 1

codeSizeAtMethod · 0.45

Calls 7

hasNewCodeMethod · 0.80
sizeMethod · 0.45
codeMethod · 0.45
codeHashMethod · 0.45
containsMethod · 0.45
getMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected