Deprecate the `vjoinsplit` field of `gettransaction` results.

Author: Kris Nuttycombe <kris@nutty.land>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Kris Nuttycombe 2022-05-11 11:27:31 -06:00 committed by Daira Hopwood
parent 3b653fca31
commit 59cabff22d
5 changed files with 23 additions and 3 deletions

View File

@ -55,6 +55,11 @@ default as of release 5.3.0.
using this metadata be updated to use the `pool` or `address_type`
attributes, which have replaced the `type` attribute, as appropriate.
### Deprecated in 5.1.0
- `wallettxvjoinsplit` - The `vjoinsplit` attribute returned by the
`gettransaction` RPC method is deprecated.
Stage 2
-------

View File

@ -25,3 +25,12 @@ by default, but may be be reenabled using `-allowdeprecated=<feature>`.
`allowdeprecated=dumpwallet`. `dumpwallet` should not be used; it is
unsafe for backup purposes as it does not return any key information
for keys used to derive shielded addresses. Use `z_exportwallet` instead.
As of this release, the following features are deprecated, but remain available
by default. These features may be disabled by setting `-allowdeprecated=none`.
After at least 3 minor-version releases, these features will be disabled by
default and the following flags to `-allowdeprecated` will be required to
permit their continued use:
- `wallettxvjoinsplit` - controls availability of the deprecated `vjoinsplit`
attribute returned by the `gettransaction` RPC method.

View File

@ -25,6 +25,7 @@ bool fEnableZCRawJoinSplit = true;
bool fEnableZCRawKeygen = true;
bool fEnableAddrTypeField = true;
bool fEnableDumpWallet = true;
bool fEnableWalletTxVJoinSplit = true;
#endif
static const std::string CLIENT_VERSION_STR = FormatVersion(CLIENT_VERSION);
@ -107,6 +108,7 @@ std::optional<std::string> SetAllowedDeprecatedFeaturesFromCLIArgs() {
fEnableZCRawKeygen = allowdeprecated.count("zcrawkeygen") > 0;
fEnableAddrTypeField = allowdeprecated.count("addrtype") > 0;
fEnableDumpWallet = allowdeprecated.count("dumpwallet") > 0;
fEnableWalletTxVJoinSplit = allowdeprecated.count("wallettxvjoinsplit") > 0;
#endif
return std::nullopt;

View File

@ -33,7 +33,8 @@ static const std::set<std::string> DEFAULT_ALLOW_DEPRECATED{{
"z_getbalance",
"z_gettotalbalance",
"z_listaddresses",
"addrtype"
"addrtype",
"wallettxvjoinsplit"
#endif
}};
static const std::set<std::string> DEFAULT_DENY_DEPRECATED{{
@ -59,6 +60,7 @@ extern bool fEnableZCRawJoinSplit;
extern bool fEnableZCRawKeygen;
extern bool fEnableAddrTypeField;
extern bool fEnableDumpWallet;
extern bool fEnableWalletTxVJoinSplit;
#endif
/**

View File

@ -151,7 +151,9 @@ void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
for (const std::pair<string, string>& item : wtx.mapValue)
entry.pushKV(item.first, item.second);
entry.pushKV("vjoinsplit", TxJoinSplitToJSON(wtx));
if (fEnableWalletTxVJoinSplit) {
entry.pushKV("vjoinsplit", TxJoinSplitToJSON(wtx));
}
}
UniValue getnewaddress(const UniValue& params, bool fHelp)
@ -1729,7 +1731,7 @@ UniValue gettransaction(const UniValue& params, bool fHelp)
" }\n"
" ,...\n"
" ],\n"
" \"vjoinsplit\" : [\n"
" \"vjoinsplit\" : (DEPRECATED) [\n"
" {\n"
" \"anchor\" : \"treestateref\", (string) Merkle root of note commitment tree\n"
" \"nullifiers\" : [ string, ... ] (string) Nullifiers of input notes\n"