Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/scriptpubkeyman.cpp
Show First 20 Lines • Show All 1,972 Lines • ▼ Show 20 Lines | bool DescriptorScriptPubKeyMan::SetupDescriptorGeneration( | ||||
// Build descriptor string | // Build descriptor string | ||||
std::string desc_prefix; | std::string desc_prefix; | ||||
std::string desc_suffix = "/*)"; | std::string desc_suffix = "/*)"; | ||||
switch (addr_type) { | switch (addr_type) { | ||||
case OutputType::LEGACY: { | case OutputType::LEGACY: { | ||||
desc_prefix = "pkh(" + xpub + "/44'"; | desc_prefix = "pkh(" + xpub + "/44'"; | ||||
break; | break; | ||||
} | } | ||||
default: | } // no default case, so the compiler can warn about missing cases | ||||
assert(false); | assert(!desc_prefix.empty()); | ||||
} | |||||
// Mainnet derives at 0', testnet and regtest derive at 1' | // Mainnet derives at 0', testnet and regtest derive at 1' | ||||
if (m_storage.GetChainParams().IsTestChain()) { | if (m_storage.GetChainParams().IsTestChain()) { | ||||
desc_prefix += "/1'"; | desc_prefix += "/1'"; | ||||
} else { | } else { | ||||
desc_prefix += "/0'"; | desc_prefix += "/0'"; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 364 Lines • Show Last 20 Lines |