diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp --- a/src/script/descriptor.cpp +++ b/src/script/descriptor.cpp @@ -277,8 +277,8 @@ m_script_arg is nullptr). * @param out A FlatSigningProvider to put scripts or public keys in that are necessary to the solver. - * The script and pubkeys argument to this function are - automatically added. + * The script arguments to this function are automatically + added, as is the origin info of the provided pubkeys. * @return A vector with scriptPubKeys for this descriptor. */ virtual std::vector @@ -415,7 +415,6 @@ for (auto &entry : entries) { pubkeys.push_back(entry.first); out.origins.emplace(entry.first.GetID(), std::move(entry.second)); - out.pubkeys.emplace(entry.first.GetID(), entry.first); } if (m_script_arg) { for (const auto &subscript : subscripts) { @@ -515,8 +514,10 @@ protected: std::vector MakeScripts(const std::vector &keys, const CScript *, - FlatSigningProvider &) const override { - return Singleton(GetScriptForDestination(keys[0].GetID())); + FlatSigningProvider &out) const override { + CKeyID id = keys[0].GetID(); + out.pubkeys.emplace(id, keys[0]); + return Singleton(GetScriptForDestination(id)); } public: @@ -532,6 +533,7 @@ FlatSigningProvider &out) const override { std::vector ret; CKeyID id = keys[0].GetID(); + out.pubkeys.emplace(id, keys[0]); // P2PK ret.emplace_back(GetScriptForRawPubKey(keys[0])); // P2PKH diff --git a/test/functional/wallet_importmulti.py b/test/functional/wallet_importmulti.py --- a/test/functional/wallet_importmulti.py +++ b/test/functional/wallet_importmulti.py @@ -506,8 +506,7 @@ self.log.info("Should import a 1-of-2 bare multisig from descriptor") self.test_importmulti({"desc": "multi(1," + key1.pubkey + "," + key2.pubkey + ")", "timestamp": "now"}, - success=True, - warnings=["Some private keys are missing, outputs will be considered watchonly. If this is intentional, specify the watchonly flag."]) + success=True) self.log.info( "Should not treat individual keys from the imported bare multisig as watchonly") test_address(self.nodes[1],