aboutsummaryrefslogtreecommitdiff
path: root/src/script/sign.cpp
diff options
context:
space:
mode:
authorBen Woosley <ben.woosley@gmail.com>2018-07-15 12:19:12 -0400
committerBen Woosley <ben.woosley@gmail.com>2019-03-04 01:15:52 -0800
commit73aaf4ecf825a4d18c802ca5dd3856ce9096915e (patch)
tree186a73f817cfa2cfcad195ab5cca3afb0bf600e6 /src/script/sign.cpp
parent2d46f1be0c3c8b7287aa1f62bb1f5b4a8d00ff6e (diff)
Make SignatureExtractorChecker private to its own file
It's only used here in DataFromTransaction
Diffstat (limited to 'src/script/sign.cpp')
-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;