diff options
-rw-r--r-- | src/script/sign.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 13481af9c5..0ed92e8d5b 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -244,6 +244,7 @@ bool ProduceSignature(const SigningProvider& provider, const BaseSignatureCreato return sigdata.complete; } +namespace { class SignatureExtractorChecker final : public BaseSignatureChecker { private: @@ -252,21 +253,17 @@ private: public: SignatureExtractorChecker(SignatureData& sigdata, BaseSignatureChecker& checker) : sigdata(sigdata), checker(checker) {} - bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const override; -}; - -bool SignatureExtractorChecker::CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const -{ - if (checker.CheckSig(scriptSig, vchPubKey, scriptCode, sigversion)) { - CPubKey pubkey(vchPubKey); - sigdata.signatures.emplace(pubkey.GetID(), SigPair(pubkey, scriptSig)); - return true; + bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const override + { + if (checker.CheckSig(scriptSig, vchPubKey, scriptCode, sigversion)) { + CPubKey pubkey(vchPubKey); + sigdata.signatures.emplace(pubkey.GetID(), SigPair(pubkey, scriptSig)); + return true; + } + return false; } - return false; -} +}; -namespace -{ struct Stacks { std::vector<valtype> script; |