aboutsummaryrefslogtreecommitdiff
path: root/src/script/ismine.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2018-04-19 21:06:47 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2018-04-19 21:06:47 -0700
commit7d0f80bbf4de8c17b6db9a035ba32698ad076e2e (patch)
treee62cc2dadae9dc067e55d69b71cbac579acd9211 /src/script/ismine.cpp
parentb61fb7113688cc25c02937f0684759dcaf247f86 (diff)
Use anonymous namespace instead of static functions
Diffstat (limited to 'src/script/ismine.cpp')
-rw-r--r--src/script/ismine.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/script/ismine.cpp b/src/script/ismine.cpp
index a987944f5b..fefa02fdef 100644
--- a/src/script/ismine.cpp
+++ b/src/script/ismine.cpp
@@ -13,6 +13,8 @@
typedef std::vector<unsigned char> valtype;
+namespace {
+
/**
* This is an enum that tracks the execution context of a script, similar to
* SigVersion in script/interpreter. It is separate however because we want to
@@ -26,12 +28,12 @@ enum class IsMineSigVersion
WITNESS_V0 = 2 //! P2WSH witness script execution
};
-static bool PermitsUncompressed(IsMineSigVersion sigversion)
+bool PermitsUncompressed(IsMineSigVersion sigversion)
{
return sigversion == IsMineSigVersion::TOP || sigversion == IsMineSigVersion::P2SH;
}
-static bool HaveKeys(const std::vector<valtype>& pubkeys, const CKeyStore& keystore)
+bool HaveKeys(const std::vector<valtype>& pubkeys, const CKeyStore& keystore)
{
for (const valtype& pubkey : pubkeys) {
CKeyID keyID = CPubKey(pubkey).GetID();
@@ -40,7 +42,7 @@ static bool HaveKeys(const std::vector<valtype>& pubkeys, const CKeyStore& keyst
return true;
}
-static isminetype IsMineInner(const CKeyStore& keystore, const CScript& scriptPubKey, bool& isInvalid, IsMineSigVersion sigversion)
+isminetype IsMineInner(const CKeyStore& keystore, const CScript& scriptPubKey, bool& isInvalid, IsMineSigVersion sigversion)
{
isInvalid = false;
@@ -154,6 +156,8 @@ static isminetype IsMineInner(const CKeyStore& keystore, const CScript& scriptPu
return ISMINE_NO;
}
+} // namespace
+
isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey, bool& isInvalid)
{
return IsMineInner(keystore, scriptPubKey, isInvalid, IsMineSigVersion::TOP);