Skip to content

Commit 85fa370

Browse files
committed
refactor: use Params().ExtCoinType() for descriptor wallets
1 parent da8e563 commit 85fa370

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/wallet/scriptpubkeyman.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,16 +2066,9 @@ bool DescriptorScriptPubKeyMan::SetupDescriptorGeneration(const CExtKey& master_
20662066
std::string xpub = EncodeExtPubKey(master_key.Neuter());
20672067

20682068
// Build descriptor string
2069-
std::string desc_prefix = "pkh(" + xpub + "/44'";
2069+
std::string desc_prefix = strprintf("pkh(%s/44'/%d'", xpub, Params().ExtCoinType());
20702070
std::string desc_suffix = "/*)";
20712071

2072-
// Mainnet derives at 5', testnet and regtest derive at 1'
2073-
if (Params().IsTestChain()) {
2074-
desc_prefix += "/1'";
2075-
} else {
2076-
desc_prefix += "/5'";
2077-
}
2078-
20792072
std::string internal_path = m_internal ? "/1" : "/0";
20802073
std::string desc_str = desc_prefix + "/0'" + internal_path + desc_suffix;
20812074

0 commit comments

Comments
 (0)