Implement LegacyScriptPubKeyMan::MigrateToDescriptor

This commit is contained in:
Andrew Chow
2020-07-13 14:32:24 -04:00
committed by Andrew Chow
parent ea1ab390e4
commit 35f428fae6
3 changed files with 275 additions and 2 deletions

View File

@@ -265,6 +265,8 @@ static const std::unordered_set<OutputType> LEGACY_OUTPUT_TYPES {
OutputType::BECH32,
};
class DescriptorScriptPubKeyMan;
class LegacyScriptPubKeyMan : public ScriptPubKeyMan, public FillableSigningProvider
{
private:
@@ -511,6 +513,10 @@ public:
std::set<CKeyID> GetKeys() const override;
const std::unordered_set<CScript, SaltedSipHasher> GetScriptPubKeys() const override;
/** Get the DescriptorScriptPubKeyMans (with private keys) that have the same scriptPubKeys as this LegacyScriptPubKeyMan.
* Does not modify this ScriptPubKeyMan. */
std::optional<MigrationData> MigrateToDescriptor();
};
/** Wraps a LegacyScriptPubKeyMan so that it can be returned in a new unique_ptr. Does not provide privkeys */