Merge pull request #5975 from nuttycom/deprecation/disable_dumpwallet
Mark the `dumpwallet` RPC method as disabled. Admin merge requested by @str4d
This commit is contained in:
commit
aad3da4d3a
|
@ -69,3 +69,10 @@ The following features are disabled by default, and will be removed in release 5
|
||||||
- `zcrawreceive` - The `zcrawreceive` RPC method is disabled.
|
- `zcrawreceive` - The `zcrawreceive` RPC method is disabled.
|
||||||
- `zcrawjoinsplit` - The `zcrawjoinsplit` RPC method is disabled.
|
- `zcrawjoinsplit` - The `zcrawjoinsplit` RPC method is disabled.
|
||||||
- `zcrawkeygen` - The `zcrawkeygen` RPC method is disabled.
|
- `zcrawkeygen` - The `zcrawkeygen` RPC method is disabled.
|
||||||
|
|
||||||
|
### Disabled in 5.0.1
|
||||||
|
|
||||||
|
The following features are disabled by default, and will be removed in release 5.3.0.
|
||||||
|
|
||||||
|
- `dumpwallet` - The `dumpwallet` RPC method is disabled.
|
||||||
|
|
||||||
|
|
|
@ -14,3 +14,14 @@ Option handling
|
||||||
whenever the transaction does not contain Orchard components. This can be
|
whenever the transaction does not contain Orchard components. This can be
|
||||||
helpful if recipients of transactions are likely to be using legacy wallets
|
helpful if recipients of transactions are likely to be using legacy wallets
|
||||||
that have not yet been upgraded to support parsing V5 transactions.
|
that have not yet been upgraded to support parsing V5 transactions.
|
||||||
|
|
||||||
|
Deprecated
|
||||||
|
----------
|
||||||
|
|
||||||
|
As of this release, the following previously deprecated features are disabled
|
||||||
|
by default, but may be be reenabled using `-allowdeprecated=<feature>`.
|
||||||
|
|
||||||
|
- The `dumpwallet` RPC method is disabled. It may be reenabled with
|
||||||
|
`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.
|
||||||
|
|
|
@ -64,7 +64,12 @@ class WalletBackupTest(BitcoinTestFramework):
|
||||||
ed2 = "-exportdir=" + self.options.tmpdir + "/node2"
|
ed2 = "-exportdir=" + self.options.tmpdir + "/node2"
|
||||||
|
|
||||||
# nodes 1, 2,3 are spenders, let's give them a keypool=100
|
# nodes 1, 2,3 are spenders, let's give them a keypool=100
|
||||||
extra_args = [["-keypool=100", ed0], ["-keypool=100", ed1], ["-keypool=100", ed2], []]
|
extra_args = [
|
||||||
|
["-keypool=100", ed0, "-allowdeprecated=dumpwallet"],
|
||||||
|
["-keypool=100", ed1, "-allowdeprecated=dumpwallet"],
|
||||||
|
["-keypool=100", ed2, "-allowdeprecated=dumpwallet"],
|
||||||
|
[]
|
||||||
|
]
|
||||||
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args)
|
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args)
|
||||||
connect_nodes(self.nodes[0], 3)
|
connect_nodes(self.nodes[0], 3)
|
||||||
connect_nodes(self.nodes[1], 3)
|
connect_nodes(self.nodes[1], 3)
|
||||||
|
|
|
@ -24,6 +24,7 @@ bool fEnableZCRawReceive = true;
|
||||||
bool fEnableZCRawJoinSplit = true;
|
bool fEnableZCRawJoinSplit = true;
|
||||||
bool fEnableZCRawKeygen = true;
|
bool fEnableZCRawKeygen = true;
|
||||||
bool fEnableAddrTypeField = true;
|
bool fEnableAddrTypeField = true;
|
||||||
|
bool fEnableDumpWallet = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const std::string CLIENT_VERSION_STR = FormatVersion(CLIENT_VERSION);
|
static const std::string CLIENT_VERSION_STR = FormatVersion(CLIENT_VERSION);
|
||||||
|
@ -105,6 +106,7 @@ std::optional<std::string> SetAllowedDeprecatedFeaturesFromCLIArgs() {
|
||||||
fEnableZCRawJoinSplit = allowdeprecated.count("zcrawjoinsplit") > 0;
|
fEnableZCRawJoinSplit = allowdeprecated.count("zcrawjoinsplit") > 0;
|
||||||
fEnableZCRawKeygen = allowdeprecated.count("zcrawkeygen") > 0;
|
fEnableZCRawKeygen = allowdeprecated.count("zcrawkeygen") > 0;
|
||||||
fEnableAddrTypeField = allowdeprecated.count("addrtype") > 0;
|
fEnableAddrTypeField = allowdeprecated.count("addrtype") > 0;
|
||||||
|
fEnableDumpWallet = allowdeprecated.count("dumpwallet") > 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
|
|
|
@ -38,9 +38,10 @@ static const std::set<std::string> DEFAULT_ALLOW_DEPRECATED{{
|
||||||
}};
|
}};
|
||||||
static const std::set<std::string> DEFAULT_DENY_DEPRECATED{{
|
static const std::set<std::string> DEFAULT_DENY_DEPRECATED{{
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
|
"dumpwallet",
|
||||||
"zcrawreceive",
|
"zcrawreceive",
|
||||||
"zcrawjoinsplit",
|
"zcrawjoinsplit",
|
||||||
"zcrawkeygen",
|
"zcrawkeygen"
|
||||||
#endif
|
#endif
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
@ -57,6 +58,7 @@ extern bool fEnableZCRawReceive;
|
||||||
extern bool fEnableZCRawJoinSplit;
|
extern bool fEnableZCRawJoinSplit;
|
||||||
extern bool fEnableZCRawKeygen;
|
extern bool fEnableZCRawKeygen;
|
||||||
extern bool fEnableAddrTypeField;
|
extern bool fEnableAddrTypeField;
|
||||||
|
extern bool fEnableDumpWallet;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -549,6 +549,13 @@ UniValue dumpwallet(const UniValue& params, bool fHelp)
|
||||||
if (!EnsureWalletIsAvailable(fHelp))
|
if (!EnsureWalletIsAvailable(fHelp))
|
||||||
return NullUniValue;
|
return NullUniValue;
|
||||||
|
|
||||||
|
if (!fEnableDumpWallet)
|
||||||
|
throw runtime_error(
|
||||||
|
"dumpwallet is DEPRECATED and will be removed in a future release\n"
|
||||||
|
"\nUse z_exportwallet instead, or restart with `-allowdeprecated=dumpwallet`\n"
|
||||||
|
"if you require backward compatibility.\n"
|
||||||
|
"See https://zcash.github.io/zcash/user/deprecation.html for more information.");
|
||||||
|
|
||||||
if (fHelp || params.size() != 1)
|
if (fHelp || params.size() != 1)
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"dumpwallet \"filename\"\n"
|
"dumpwallet \"filename\"\n"
|
||||||
|
|
Loading…
Reference in New Issue