Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 3,271 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 0) { | ||||
"keys are used)\n" | "keys are used)\n" | ||||
" \"unlocked_until\": ttt, (numeric) the timestamp in " | " \"unlocked_until\": ttt, (numeric) the timestamp in " | ||||
"seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is " | "seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is " | ||||
"unlocked for transfers, or 0 if the wallet is locked\n" | "unlocked for transfers, or 0 if the wallet is locked\n" | ||||
" \"paytxfee\": x.xxxx, (numeric) the transaction " | " \"paytxfee\": x.xxxx, (numeric) the transaction " | ||||
"fee configuration, set in " + | "fee configuration, set in " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
"/kB\n" | "/kB\n" | ||||
" \"hdmasterkeyid\": \"<hash160>\" (string, optional) the " | " \"hdseedid\": \"<hash160>\" (string, optional) the " | ||||
"Hash160 of the HD master pubkey (only present when HD is " | "Hash160 of the HD seed (only present when HD is enabled)\n" | ||||
"enabled)\n" | " \"hdmasterkeyid\": \"<hash160>\" (string, optional) alias " | ||||
"for hdseedid retained for backwards-compatibility. Will be " | |||||
"removed in V0.21.\n" | |||||
"}\n" | "}\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("getwalletinfo", "") + | HelpExampleCli("getwalletinfo", "") + | ||||
HelpExampleRpc("getwalletinfo", "")); | HelpExampleRpc("getwalletinfo", "")); | ||||
} | } | ||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
Show All 19 Lines | if (!seed_id.IsNull() && pwallet->CanSupportFeature(FEATURE_HD_SPLIT)) { | ||||
obj.pushKV("keypoolsize_hd_internal", | obj.pushKV("keypoolsize_hd_internal", | ||||
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("hdmasterkeyid", seed_id.GetHex()); | obj.pushKV("hdmasterkeyid", seed_id.GetHex()); | ||||
} | } | ||||
return obj; | return obj; | ||||
} | } | ||||
static UniValue listwallets(const Config &config, | static UniValue listwallets(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 0) { | if (request.fHelp || request.params.size() != 0) { | ||||
▲ Show 20 Lines • Show All 1,025 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 1) { | ||||
"compressed\n" | "compressed\n" | ||||
" \"account\" : \"account\" (string) The account " | " \"account\" : \"account\" (string) The account " | ||||
"associated with the address, \"\" is the default account\n" | "associated with the address, \"\" is the default account\n" | ||||
" \"timestamp\" : timestamp, (number, optional) The creation " | " \"timestamp\" : timestamp, (number, optional) The creation " | ||||
"time of the key if available in seconds since epoch (Jan 1 1970 " | "time of the key if available in seconds since epoch (Jan 1 1970 " | ||||
"GMT)\n" | "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" | ||||
" \"hdmasterkeyid\" : \"<hash160>\" (string, optional) The " | " \"hdseedid\" : \"<hash160>\" (string, optional) The " | ||||
"Hash160 of the HD master pubkey\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" | |||||
"}\n" | "}\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("getaddressinfo", | HelpExampleCli("getaddressinfo", | ||||
"\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"") + | "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"") + | ||||
HelpExampleRpc("getaddressinfo", | HelpExampleRpc("getaddressinfo", | ||||
"\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")); | "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"")); | ||||
} | } | ||||
Show All 36 Lines | if (!meta) { | ||||
if (it != pwallet->m_script_metadata.end()) { | if (it != pwallet->m_script_metadata.end()) { | ||||
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("hdmasterkeyid", meta->hd_seed_id.GetHex()); | ret.pushKV("hdmasterkeyid", meta->hd_seed_id.GetHex()); | ||||
} | } | ||||
} | } | ||||
return ret; | return ret; | ||||
} | } | ||||
static UniValue sethdseed(const Config &config, const JSONRPCRequest &request) { | static UniValue sethdseed(const Config &config, const JSONRPCRequest &request) { | ||||
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | ||||
▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines |