Disable Sapling features on mainnet

Also places them behind an experimental features flag on testnet
This commit is contained in:
Jack Grigg
2018-08-13 14:18:18 +01:00
parent dfcf33fe15
commit 554e00e8f9
4 changed files with 24 additions and 9 deletions

View File

@@ -3133,9 +3133,13 @@ UniValue z_getnewaddress(const UniValue& params, bool fHelp)
addrType = params[0].get_str();
}
bool allowSapling = Params().NetworkIDString() == "regtest" || (
Params().NetworkIDString() == "test" &&
GetBoolArg("-experimentalfeatures", false) &&
GetBoolArg("-developersapling", false));
if (addrType == ADDR_TYPE_SPROUT) {
return EncodePaymentAddress(pwalletMain->GenerateNewZKey());
} else if (addrType == ADDR_TYPE_SAPLING) {
} else if (addrType == ADDR_TYPE_SAPLING && allowSapling) {
return EncodePaymentAddress(pwalletMain->GenerateNewSaplingZKey());
} else {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid address type");