Skip to content

Commit

Permalink
refactor: use Params().ExtCoinType() for descriptor wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
knst committed Mar 6, 2024
1 parent da8e563 commit 85fa370
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/wallet/scriptpubkeyman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 85fa370

Please sign in to comment.