MCPcopy Create free account
hub / github.com/Bitcoin-ABC/bitcoin-abc / RunMemoizedCheck

Function RunMemoizedCheck

src/script/sigcache.cpp:56–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54
55template <typename F>
56bool RunMemoizedCheck(SignatureCache &signatureCache,
57 const std::vector<uint8_t> &vchSig, const CPubKey &pubkey,
58 const uint256 &sighash, bool storeOrErase, const F &fun) {
59 uint256 entry;
60 signatureCache.ComputeEntry(entry, sighash, vchSig, pubkey);
61 if (signatureCache.Get(entry, !storeOrErase)) {
62 return true;
63 }
64 if (!fun()) {
65 return false;
66 }
67 if (storeOrErase) {
68 signatureCache.Set(entry);
69 }
70 return true;
71}
72
73bool CachingTransactionSignatureChecker::IsCached(
74 const std::vector<uint8_t> &vchSig, const CPubKey &pubkey,

Callers 2

IsCachedMethod · 0.85
VerifySignatureMethod · 0.85

Calls 3

ComputeEntryMethod · 0.80
GetMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected