diff options
author | dergoegge <n.goeggi@gmail.com> | 2024-03-21 11:35:11 +0000 |
---|---|---|
committer | dergoegge <n.goeggi@gmail.com> | 2024-04-07 14:04:45 +0100 |
commit | 78407b99ed6dd17f687fcbfb0486ecc433302287 (patch) | |
tree | 61eca950e0d5b18ee4a8616ef913cf9ba3613746 /src/script | |
parent | f0794cbd405636a7f528a60f2873050b865cf7e8 (diff) | |
download | bitcoin-78407b99ed6dd17f687fcbfb0486ecc433302287.tar.xz |
[clang-tidy] Enable the misc-no-recursion check
Co-authored-by: stickies-v <stickies-v@protonmail.com>
Co-authored-by: Gloria Zhao <gloriajzhao@gmail.com>
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/descriptor.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp index a0e755afac..a11d4dcbd5 100644 --- a/src/script/descriptor.cpp +++ b/src/script/descriptor.cpp @@ -599,6 +599,7 @@ public: COMPAT, // string calculation that mustn't change over time to stay compatible with previous software versions }; + // NOLINTNEXTLINE(misc-no-recursion) bool IsSolvable() const override { for (const auto& arg : m_subdescriptor_args) { @@ -607,6 +608,7 @@ public: return true; } + // NOLINTNEXTLINE(misc-no-recursion) bool IsRange() const final { for (const auto& pubkey : m_pubkey_args) { @@ -618,6 +620,7 @@ public: return false; } + // NOLINTNEXTLINE(misc-no-recursion) virtual bool ToStringSubScriptHelper(const SigningProvider* arg, std::string& ret, const StringType type, const DescriptorCache* cache = nullptr) const { size_t pos = 0; @@ -630,6 +633,7 @@ public: return true; } + // NOLINTNEXTLINE(misc-no-recursion) virtual bool ToStringHelper(const SigningProvider* arg, std::string& out, const StringType type, const DescriptorCache* cache = nullptr) const { std::string extra = ToStringExtra(); @@ -682,6 +686,7 @@ public: return ret; } + // NOLINTNEXTLINE(misc-no-recursion) bool ExpandHelper(int pos, const SigningProvider& arg, const DescriptorCache* read_cache, std::vector<CScript>& output_scripts, FlatSigningProvider& out, DescriptorCache* write_cache) const { std::vector<std::pair<CPubKey, KeyOriginInfo>> entries; @@ -723,6 +728,7 @@ public: return ExpandHelper(pos, DUMMY_SIGNING_PROVIDER, &read_cache, output_scripts, out, nullptr); } + // NOLINTNEXTLINE(misc-no-recursion) void ExpandPrivate(int pos, const SigningProvider& provider, FlatSigningProvider& out) const final { for (const auto& p : m_pubkey_args) { @@ -750,6 +756,7 @@ public: std::optional<int64_t> MaxSatisfactionElems() const override { return {}; } + // NOLINTNEXTLINE(misc-no-recursion) void GetPubKeys(std::set<CPubKey>& pubkeys, std::set<CExtPubKey>& ext_pubs) const override { for (const auto& p : m_pubkey_args) { @@ -1579,6 +1586,7 @@ struct KeyParser { }; /** Parse a script in a particular context. */ +// NOLINTNEXTLINE(misc-no-recursion) std::unique_ptr<DescriptorImpl> ParseScript(uint32_t& key_exp_index, Span<const char>& sp, ParseScriptContext ctx, FlatSigningProvider& out, std::string& error) { using namespace spanparsing; @@ -1886,6 +1894,7 @@ std::unique_ptr<DescriptorImpl> InferMultiA(const CScript& script, ParseScriptCo return std::make_unique<MultiADescriptor>(match->first, std::move(keys)); } +// NOLINTNEXTLINE(misc-no-recursion) std::unique_ptr<DescriptorImpl> InferScript(const CScript& script, ParseScriptContext ctx, const SigningProvider& provider) { if (ctx == ParseScriptContext::P2TR && script.size() == 34 && script[0] == 32 && script[33] == OP_CHECKSIG) { |