Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 2,354 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 2) { | ||||
HelpExampleRpc("walletpassphrase", "\"my pass phrase\", 60")}, | HelpExampleRpc("walletpassphrase", "\"my pass phrase\", 60")}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
auto locked_chain = pwallet->chain().lock(); | auto locked_chain = pwallet->chain().lock(); | ||||
LOCK(pwallet->cs_wallet); | LOCK(pwallet->cs_wallet); | ||||
if (request.fHelp) { | |||||
return true; | |||||
} | |||||
if (!pwallet->IsCrypted()) { | if (!pwallet->IsCrypted()) { | ||||
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, | throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, | ||||
"Error: running with an unencrypted wallet, but " | "Error: running with an unencrypted wallet, but " | ||||
"walletpassphrase was called."); | "walletpassphrase was called."); | ||||
} | } | ||||
// Note that the walletpassphrase is stored in request.params[0] which is | // Note that the walletpassphrase is stored in request.params[0] which is | ||||
// not mlock()ed | // not mlock()ed | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 2) { | ||||
"\"old one\", \"new one\"")}, | "\"old one\", \"new one\"")}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
auto locked_chain = pwallet->chain().lock(); | auto locked_chain = pwallet->chain().lock(); | ||||
LOCK(pwallet->cs_wallet); | LOCK(pwallet->cs_wallet); | ||||
if (request.fHelp) { | |||||
return true; | |||||
} | |||||
if (!pwallet->IsCrypted()) { | if (!pwallet->IsCrypted()) { | ||||
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, | throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, | ||||
"Error: running with an unencrypted wallet, but " | "Error: running with an unencrypted wallet, but " | ||||
"walletpassphrasechange was called."); | "walletpassphrasechange was called."); | ||||
} | } | ||||
// TODO: get rid of these .c_str() calls by implementing | // TODO: get rid of these .c_str() calls by implementing | ||||
// SecureString::operator=(std::string) | // SecureString::operator=(std::string) | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 0) { | ||||
HelpExampleRpc("walletlock", "")}, | HelpExampleRpc("walletlock", "")}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
auto locked_chain = pwallet->chain().lock(); | auto locked_chain = pwallet->chain().lock(); | ||||
LOCK(pwallet->cs_wallet); | LOCK(pwallet->cs_wallet); | ||||
if (request.fHelp) { | |||||
return true; | |||||
} | |||||
if (!pwallet->IsCrypted()) { | if (!pwallet->IsCrypted()) { | ||||
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, | throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, | ||||
"Error: running with an unencrypted wallet, but " | "Error: running with an unencrypted wallet, but " | ||||
"walletlock was called."); | "walletlock was called."); | ||||
} | } | ||||
pwallet->Lock(); | pwallet->Lock(); | ||||
pwallet->nRelockTime = 0; | pwallet->nRelockTime = 0; | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 1) { | ||||
HelpExampleRpc("encryptwallet", "\"my pass phrase\"")}, | HelpExampleRpc("encryptwallet", "\"my pass phrase\"")}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
auto locked_chain = pwallet->chain().lock(); | auto locked_chain = pwallet->chain().lock(); | ||||
LOCK(pwallet->cs_wallet); | LOCK(pwallet->cs_wallet); | ||||
if (request.fHelp) { | |||||
return true; | |||||
} | |||||
if (pwallet->IsCrypted()) { | if (pwallet->IsCrypted()) { | ||||
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, | throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, | ||||
"Error: running with an encrypted wallet, but " | "Error: running with an encrypted wallet, but " | ||||
"encryptwallet was called."); | "encryptwallet was called."); | ||||
} | } | ||||
// TODO: get rid of this .c_str() by implementing | // TODO: get rid of this .c_str() by implementing | ||||
// SecureString::operator=(std::string) | // SecureString::operator=(std::string) | ||||
▲ Show 20 Lines • Show All 2,409 Lines • Show Last 20 Lines |