| 54 | |
| 55 | template <typename F> |
| 56 | bool 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 | |
| 73 | bool CachingTransactionSignatureChecker::IsCached( |
| 74 | const std::vector<uint8_t> &vchSig, const CPubKey &pubkey, |
no test coverage detected