diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp --- a/src/script/descriptor.cpp +++ b/src/script/descriptor.cpp @@ -253,7 +253,7 @@ //! of Multisig). const std::vector> m_pubkey_args; //! The sub-descriptor argument (nullptr for everything but SH). - const std::unique_ptr m_script_arg; + const std::unique_ptr m_script_arg; //! The string name of the descriptor function. const std::string m_name; @@ -283,7 +283,8 @@ public: DescriptorImpl(std::vector> pubkeys, - std::unique_ptr script, const std::string &name) + std::unique_ptr script, + const std::string &name) : m_pubkey_args(std::move(pubkeys)), m_script_arg(std::move(script)), m_name(name) {} @@ -532,7 +533,7 @@ } public: - SHDescriptor(std::unique_ptr desc) + SHDescriptor(std::unique_ptr desc) : DescriptorImpl({}, std::move(desc), "sh") {} }; @@ -716,9 +717,9 @@ } /** Parse a script in a particular context. */ -std::unique_ptr ParseScript(Span &sp, - ParseScriptContext ctx, - FlatSigningProvider &out) { +std::unique_ptr ParseScript(Span &sp, + ParseScriptContext ctx, + FlatSigningProvider &out) { auto expr = Expr(sp); if (Func("pk", expr)) { auto pubkey = ParsePubkey(expr, out); @@ -820,9 +821,9 @@ return key_provider; } -std::unique_ptr InferScript(const CScript &script, - ParseScriptContext ctx, - const SigningProvider &provider) { +std::unique_ptr InferScript(const CScript &script, + ParseScriptContext ctx, + const SigningProvider &provider) { std::vector> data; txnouttype txntype = Solver(script, data); @@ -881,7 +882,7 @@ Span sp(descriptor.data(), descriptor.size()); auto ret = ParseScript(sp, ParseScriptContext::TOP, out); if (sp.size() == 0 && ret) { - return ret; + return std::unique_ptr(std::move(ret)); } return nullptr; }