From f8b3e9489ae561937a4027b3a191bb020c43f0f9 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 13 Mar 2023 15:46:05 +0000 Subject: [PATCH 1/2] Move `fEnableAddrTypeField` outside `ENABLE_WALLET` The deprecated feature was originally only applied to wallet code, but in zcash/zcash#6282 it was extended to a missing case in non-wallet code. --- src/deprecation.cpp | 4 ++-- src/deprecation.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/deprecation.cpp b/src/deprecation.cpp index b2fea4e53..1dd4c4fe1 100644 --- a/src/deprecation.cpp +++ b/src/deprecation.cpp @@ -14,6 +14,7 @@ // Flags that enable deprecated functionality. bool fEnableGbtOldHashes = true; bool fEnableDeprecationInfoDeprecationHeight = true; +bool fEnableAddrTypeField = true; #ifdef ENABLE_WALLET bool fEnableGetNewAddress = true; bool fEnableGetRawChangeAddress = true; @@ -22,7 +23,6 @@ bool fEnableZGetBalance = true; bool fEnableZGetTotalBalance = true; bool fEnableZListAddresses = true; bool fEnableLegacyPrivacyStrategy = true; -bool fEnableAddrTypeField = true; bool fEnableWalletTxVJoinSplit = true; #endif @@ -101,6 +101,7 @@ std::optional LoadAllowedDeprecatedFeatures() { fEnableGbtOldHashes = allowdeprecated.count("gbt_oldhashes") > 0; fEnableDeprecationInfoDeprecationHeight = allowdeprecated.count("deprecationinfo_deprecationheight") > 0; + fEnableAddrTypeField = allowdeprecated.count("addrtype") > 0; #ifdef ENABLE_WALLET fEnableLegacyPrivacyStrategy = allowdeprecated.count("legacy_privacy") > 0; fEnableGetNewAddress = allowdeprecated.count("getnewaddress") > 0; @@ -109,7 +110,6 @@ std::optional LoadAllowedDeprecatedFeatures() { fEnableZGetBalance = allowdeprecated.count("z_getbalance") > 0; fEnableZGetTotalBalance = allowdeprecated.count("z_gettotalbalance") > 0; fEnableZListAddresses = allowdeprecated.count("z_listaddresses") > 0; - fEnableAddrTypeField = allowdeprecated.count("addrtype") > 0; fEnableWalletTxVJoinSplit = allowdeprecated.count("wallettxvjoinsplit") > 0; #endif diff --git a/src/deprecation.h b/src/deprecation.h index e98e935da..3e939a837 100644 --- a/src/deprecation.h +++ b/src/deprecation.h @@ -52,6 +52,7 @@ static const std::set DEFAULT_DENY_DEPRECATED{{ // Flags that enable deprecated functionality. extern bool fEnableGbtOldHashes; extern bool fEnableDeprecationInfoDeprecationHeight; +extern bool fEnableAddrTypeField; #ifdef ENABLE_WALLET extern bool fEnableGetNewAddress; extern bool fEnableGetRawChangeAddress; @@ -60,7 +61,6 @@ extern bool fEnableZGetBalance; extern bool fEnableZGetTotalBalance; extern bool fEnableZListAddresses; extern bool fEnableLegacyPrivacyStrategy; -extern bool fEnableAddrTypeField; extern bool fEnableWalletTxVJoinSplit; #endif From ce733419514f34dce184f785416b839f40b879fc Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 13 Mar 2023 15:47:55 +0000 Subject: [PATCH 2/2] `s/string/std::string` in `init.cpp` This was breaking with `--disable-wallet`, likely due to some PR removing a `using namespace std;` line from a header file that this code was implicitly depending on. --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 2d950215b..aab125239 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -334,7 +334,7 @@ std::string HelpMessage(HelpMessageMode mode) // When adding new options to the categories, please keep and ensure alphabetical ordering. // Do not translate _(...) -help-debug options, Many technical terms, and only a very small audience, so is unnecessary stress to translators. - string strUsage = HelpMessageGroup(_("Options:")); + std::string strUsage = HelpMessageGroup(_("Options:")); strUsage += HelpMessageOpt("-?", _("Print this help message and exit")); strUsage += HelpMessageOpt("-version", _("Print version and exit")); strUsage += HelpMessageOpt("-alerts", strprintf(_("Receive and display P2P network alerts (default: %u)"), DEFAULT_ALERTS));