aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/script/sign.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp
index 320956d0c4..4af66008d6 100644
--- a/src/script/sign.cpp
+++ b/src/script/sign.cpp
@@ -243,6 +243,7 @@ bool ProduceSignature(const SigningProvider& provider, const BaseSignatureCreato
return sigdata.complete;
}
+namespace {
class SignatureExtractorChecker final : public BaseSignatureChecker
{
private:
@@ -251,21 +252,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;