add -orchardwallet experimental feature flag

Also, temporarily don't allow -orchardwallet if running mainnet.
This commit is contained in:
Larry Ruane 2021-09-21 11:45:59 -06:00
parent d0b85b69f3
commit cc70cd2c46
3 changed files with 13 additions and 0 deletions

View File

@ -11,6 +11,7 @@ bool fExperimentalDeveloperSetPoolSizeZero = false;
bool fExperimentalPaymentDisclosure = false;
bool fExperimentalInsightExplorer = false;
bool fExperimentalLightWalletd = false;
bool fExperimentalOrchardWallet = false;
std::optional<std::string> InitExperimentalMode()
{
@ -20,6 +21,7 @@ std::optional<std::string> InitExperimentalMode()
fExperimentalPaymentDisclosure = GetBoolArg("-paymentdisclosure", false);
fExperimentalInsightExplorer = GetBoolArg("-insightexplorer", false);
fExperimentalLightWalletd = GetBoolArg("-lightwalletd", false);
fExperimentalOrchardWallet = GetBoolArg("-orchardwallet", false);
// Fail if user has set experimental options without the global flag
if (!fExperimentalMode) {
@ -33,6 +35,8 @@ std::optional<std::string> InitExperimentalMode()
return _("Insight explorer requires -experimentalfeatures.");
} else if (fExperimentalLightWalletd) {
return _("Light Walletd requires -experimentalfeatures.");
} else if (fExperimentalOrchardWallet) {
return _("Orchard-enabled wallet requires -experimentalfeatures.");
}
}
return std::nullopt;
@ -51,6 +55,8 @@ std::vector<std::string> GetExperimentalFeatures()
experimentalfeatures.push_back("insightexplorer");
if (fExperimentalLightWalletd)
experimentalfeatures.push_back("lightwalletd");
if (fExperimentalOrchardWallet)
experimentalfeatures.push_back("orchardwallet");
return experimentalfeatures;
}

View File

@ -14,6 +14,7 @@ extern bool fExperimentalDeveloperSetPoolSizeZero;
extern bool fExperimentalPaymentDisclosure;
extern bool fExperimentalInsightExplorer;
extern bool fExperimentalLightWalletd;
extern bool fExperimentalOrchardWallet;
std::optional<std::string> InitExperimentalMode();
std::vector<std::string> GetExperimentalFeatures();

View File

@ -947,6 +947,12 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
return InitError(err.value());
}
// Just temporarily (until fully functional), don't allow the Orchard wallet
// extensions if we're on mainnet
if (fExperimentalOrchardWallet && chainparams.NetworkIDString() == "main") {
return InitError(_("The -orchardwallet setting is not yet available on mainnet."));
}
// if using block pruning, then disable txindex
if (GetArg("-prune", 0)) {
if (GetBoolArg("-txindex", DEFAULT_TXINDEX))