Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 2,917 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 0) { | ||||
"wallet is unlocked for transfers, or 0 if the wallet is " | "wallet is unlocked for transfers, or 0 if the wallet is " | ||||
"locked\n" | "locked\n" | ||||
" \"paytxfee\": x.xxxx, (numeric) the " | " \"paytxfee\": x.xxxx, (numeric) the " | ||||
"transaction fee configuration, set in " + | "transaction fee configuration, set in " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
"/kB\n" | "/kB\n" | ||||
" \"hdseedid\": \"<hash160>\" (string, optional) the " | " \"hdseedid\": \"<hash160>\" (string, optional) the " | ||||
"Hash160 of the HD seed (only present when HD is enabled)\n" | "Hash160 of the HD seed (only present when HD is enabled)\n" | ||||
" \"hdmasterkeyid\": \"<hash160>\" (string, optional) " | |||||
"alias for hdseedid retained for backwards-compatibility. Will " | |||||
"be removed in V0.21.\n" | |||||
" \"private_keys_enabled\": true|false (boolean) false if " | " \"private_keys_enabled\": true|false (boolean) false if " | ||||
"privatekeys are disabled for this wallet (enforced watch-only " | "privatekeys are disabled for this wallet (enforced watch-only " | ||||
"wallet)\n" | "wallet)\n" | ||||
"}\n"}, | "}\n"}, | ||||
RPCExamples{HelpExampleCli("getwalletinfo", "") + | RPCExamples{HelpExampleCli("getwalletinfo", "") + | ||||
HelpExampleRpc("getwalletinfo", "")}, | HelpExampleRpc("getwalletinfo", "")}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
Show All 25 Lines | if (!seed_id.IsNull() && pwallet->CanSupportFeature(FEATURE_HD_SPLIT)) { | ||||
int64_t(pwallet->GetKeyPoolSize() - kpExternalSize)); | int64_t(pwallet->GetKeyPoolSize() - kpExternalSize)); | ||||
} | } | ||||
if (pwallet->IsCrypted()) { | if (pwallet->IsCrypted()) { | ||||
obj.pushKV("unlocked_until", pwallet->nRelockTime); | obj.pushKV("unlocked_until", pwallet->nRelockTime); | ||||
} | } | ||||
obj.pushKV("paytxfee", ValueFromAmount(pwallet->m_pay_tx_fee.GetFeePerK())); | obj.pushKV("paytxfee", ValueFromAmount(pwallet->m_pay_tx_fee.GetFeePerK())); | ||||
if (!seed_id.IsNull()) { | if (!seed_id.IsNull()) { | ||||
obj.pushKV("hdseedid", seed_id.GetHex()); | obj.pushKV("hdseedid", seed_id.GetHex()); | ||||
obj.pushKV("hdmasterkeyid", seed_id.GetHex()); | |||||
} | } | ||||
obj.pushKV("private_keys_enabled", | obj.pushKV("private_keys_enabled", | ||||
!pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)); | !pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)); | ||||
return obj; | return obj; | ||||
} | } | ||||
static UniValue listwalletdir(const Config &config, | static UniValue listwalletdir(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
▲ Show 20 Lines • Show All 1,173 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 1) { | ||||
"associated with the address, \"\" is the default label\n" | "associated with the address, \"\" is the default label\n" | ||||
" \"timestamp\" : timestamp, (number, optional) The " | " \"timestamp\" : timestamp, (number, optional) The " | ||||
"creation time of the key if available in seconds since epoch " | "creation time of the key if available in seconds since epoch " | ||||
"(Jan 1 1970 GMT)\n" | "(Jan 1 1970 GMT)\n" | ||||
" \"hdkeypath\" : \"keypath\" (string, optional) The HD " | " \"hdkeypath\" : \"keypath\" (string, optional) The HD " | ||||
"keypath if the key is HD and available\n" | "keypath if the key is HD and available\n" | ||||
" \"hdseedid\" : \"<hash160>\" (string, optional) The " | " \"hdseedid\" : \"<hash160>\" (string, optional) The " | ||||
"Hash160 of the HD seed\n" | "Hash160 of the HD seed\n" | ||||
" \"hdmasterkeyid\" : \"<hash160>\" (string, optional) alias " | |||||
"for hdseedid maintained for backwards compatibility. Will be " | |||||
"removed in V0.21.\n" | |||||
" \"labels\" (object) Array of labels " | " \"labels\" (object) Array of labels " | ||||
"associated with the address.\n" | "associated with the address.\n" | ||||
" [\n" | " [\n" | ||||
" { (json object of label data)\n" | " { (json object of label data)\n" | ||||
" \"name\": \"labelname\" (string) The label\n" | " \"name\": \"labelname\" (string) The label\n" | ||||
" \"purpose\": \"string\" (string) Purpose of address " | " \"purpose\": \"string\" (string) Purpose of address " | ||||
"(\"send\" for sending address, \"receive\" for receiving " | "(\"send\" for sending address, \"receive\" for receiving " | ||||
"address)\n" | "address)\n" | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | if (!meta) { | ||||
meta = &it->second; | meta = &it->second; | ||||
} | } | ||||
} | } | ||||
if (meta) { | if (meta) { | ||||
ret.pushKV("timestamp", meta->nCreateTime); | ret.pushKV("timestamp", meta->nCreateTime); | ||||
if (!meta->hdKeypath.empty()) { | if (!meta->hdKeypath.empty()) { | ||||
ret.pushKV("hdkeypath", meta->hdKeypath); | ret.pushKV("hdkeypath", meta->hdKeypath); | ||||
ret.pushKV("hdseedid", meta->hd_seed_id.GetHex()); | ret.pushKV("hdseedid", meta->hd_seed_id.GetHex()); | ||||
ret.pushKV("hdmasterkeyid", meta->hd_seed_id.GetHex()); | |||||
} | } | ||||
} | } | ||||
// Currently only one label can be associated with an address, return an | // Currently only one label can be associated with an address, return an | ||||
// array so the API remains stable if we allow multiple labels to be | // array so the API remains stable if we allow multiple labels to be | ||||
// associated with an address. | // associated with an address. | ||||
UniValue labels(UniValue::VARR); | UniValue labels(UniValue::VARR); | ||||
std::map<CTxDestination, CAddressBookData>::iterator mi = | std::map<CTxDestination, CAddressBookData>::iterator mi = | ||||
▲ Show 20 Lines • Show All 559 Lines • Show Last 20 Lines |