mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge #8775: RPC refactoring: Access wallet using new GetWalletForJSONRPCRequest
d678771Wallet: Sanitise -wallet parameter (Luke Dashjr)9756be3Wallet/RPC: Use filename rather than CWallet pointer, for lockwallet RPCRunLater job name (Luke Dashjr)86be48aMore tightly couple EnsureWalletIsAvailable with GetWalletForJSONRPCRequest where appropriate (Luke Dashjr)a435632Move wallet RPC declarations to rpcwallet.h (Luke Dashjr)ad15734RPC: Pass on JSONRPCRequest metadata (URI/user/etc) for "help" method (Luke Dashjr)bf8a04aReformat touched lines with C++11 (Luke Dashjr)2e518e3Move nWalletUnlockTime to CWallet::nRelockTime, and name timed task unique per CWallet (Luke Dashjr)d77ad6dRPC: Do all wallet access through new GetWalletForJSONRPCRequest (Luke Dashjr)eca550fRPC/Wallet: Pass CWallet as pointer to helper functions (Luke Dashjr) Tree-SHA512: bfd592da841693390e16f83b451503eb5cedb71208089aa32b3fc45e973555584a3ed7696dd239f6409324464d565dacf0f3d0e36e8e13ae6a7843848465f960
This commit is contained in:
@@ -3770,6 +3770,12 @@ bool CWallet::InitLoadWallet()
|
||||
|
||||
std::string walletFile = GetArg("-wallet", DEFAULT_WALLET_DAT);
|
||||
|
||||
if (walletFile.find_first_of("/\\") != std::string::npos) {
|
||||
return InitError(_("-wallet parameter must only specify a filename (not a path)"));
|
||||
} else if (SanitizeString(walletFile, SAFE_CHARS_FILENAME) != walletFile) {
|
||||
return InitError(_("Invalid characters in -wallet filename"));
|
||||
}
|
||||
|
||||
CWallet * const pwallet = CreateWalletFromFile(walletFile);
|
||||
if (!pwallet) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user