Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | if (avoid_reuse && !can_avoid_reuse) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_WALLET_ERROR, | RPC_WALLET_ERROR, | ||||
"wallet does not have the \"avoid reuse\" feature enabled"); | "wallet does not have the \"avoid reuse\" feature enabled"); | ||||
} | } | ||||
return avoid_reuse; | return avoid_reuse; | ||||
} | } | ||||
/** | |||||
* Checks if a CKey is in the given CWallet compressed or otherwise | |||||
*/ | |||||
bool HaveKey(const CWallet &wallet, const CKey &key) { | |||||
CKey key2; | |||||
key2.Set(key.begin(), key.end(), !key.IsCompressed()); | |||||
return wallet.HaveKey(key.GetPubKey().GetID()) || | |||||
wallet.HaveKey(key2.GetPubKey().GetID()); | |||||
} | |||||
bool GetWalletNameFromJSONRPCRequest(const JSONRPCRequest &request, | bool GetWalletNameFromJSONRPCRequest(const JSONRPCRequest &request, | ||||
std::string &wallet_name) { | std::string &wallet_name) { | ||||
if (request.URI.substr(0, WALLET_ENDPOINT_BASE.size()) == | if (request.URI.substr(0, WALLET_ENDPOINT_BASE.size()) == | ||||
WALLET_ENDPOINT_BASE) { | WALLET_ENDPOINT_BASE) { | ||||
// wallet endpoint was used | // wallet endpoint was used | ||||
wallet_name = | wallet_name = | ||||
urlDecode(request.URI.substr(WALLET_ENDPOINT_BASE.size())); | urlDecode(request.URI.substr(WALLET_ENDPOINT_BASE.size())); | ||||
return true; | return true; | ||||
▲ Show 20 Lines • Show All 4,942 Lines • Show Last 20 Lines |