From 85fa37068fa3f8b06240ec5168c09392ef2d0cb2 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Tue, 27 Feb 2024 16:29:40 +0700 Subject: [PATCH] refactor: use Params().ExtCoinType() for descriptor wallets --- src/wallet/scriptpubkeyman.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 9d955fd832c6b..39c1446300f86 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -2066,16 +2066,9 @@ bool DescriptorScriptPubKeyMan::SetupDescriptorGeneration(const CExtKey& master_ std::string xpub = EncodeExtPubKey(master_key.Neuter()); // Build descriptor string - std::string desc_prefix = "pkh(" + xpub + "/44'"; + std::string desc_prefix = strprintf("pkh(%s/44'/%d'", xpub, Params().ExtCoinType()); std::string desc_suffix = "/*)"; - // Mainnet derives at 5', testnet and regtest derive at 1' - if (Params().IsTestChain()) { - desc_prefix += "/1'"; - } else { - desc_prefix += "/5'"; - } - std::string internal_path = m_internal ? "/1" : "/0"; std::string desc_str = desc_prefix + "/0'" + internal_path + desc_suffix;