Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 3,283 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,077 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 1) { | ||||
"is \"multisig\")\n" | "is \"multisig\")\n" | ||||
" \"pubkey\" : \"publickeyhex\", (string, optional) The hex " | " \"pubkey\" : \"publickeyhex\", (string, optional) The hex " | ||||
"value of the raw public key, for single-key addresses (possibly " | "value of the raw public key, for single-key addresses (possibly " | ||||
"embedded in P2SH or P2WSH)\n" | "embedded in P2SH or P2WSH)\n" | ||||
" \"embedded\" : {...}, (object, optional) Information " | " \"embedded\" : {...}, (object, optional) Information " | ||||
"about the address embedded in P2SH or P2WSH, if relevant and " | "about the address embedded in P2SH or P2WSH, if relevant and " | ||||
"known. It includes all getaddressinfo output fields for the " | "known. It includes all getaddressinfo output fields for the " | ||||
"embedded address, excluding metadata (\"timestamp\", " | "embedded address, excluding metadata (\"timestamp\", " | ||||
"\"hdkeypath\", \"hdmasterkeyid\") and relation to the wallet " | "\"hdkeypath\", \"hdseedid\") and relation to the wallet " | ||||
"(\"ismine\", \"iswatchonly\", \"account\").\n" | "(\"ismine\", \"iswatchonly\", \"account\").\n" | ||||
" \"iscompressed\" : true|false, (boolean) If the address is " | " \"iscompressed\" : true|false, (boolean) If the address is " | ||||
"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 All 25 Lines | if (request.fHelp || request.params.size() > 2) { | ||||
"enabled) from the existing\n" | "enabled) from the existing\n" | ||||
" keypool will be used until it has " | " keypool will be used until it has " | ||||
"been depleted.\n" | "been depleted.\n" | ||||
"2. \"seed\" (string, optional) The WIF private key " | "2. \"seed\" (string, optional) The WIF private key " | ||||
"to use as the new HD seed; if not provided a random seed will be " | "to use as the new HD seed; if not provided a random seed will be " | ||||
"used.\n" | "used.\n" | ||||
" The seed value can be retrieved " | " The seed value can be retrieved " | ||||
"using the dumpwallet command. It is the private key marked " | "using the dumpwallet command. It is the private key marked " | ||||
"hdmaster=1\n" | "hdseed=1\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("sethdseed", "") + | HelpExampleCli("sethdseed", "") + | ||||
HelpExampleCli("sethdseed", "false") + | HelpExampleCli("sethdseed", "false") + | ||||
HelpExampleCli("sethdseed", "true \"wifkey\"") + | HelpExampleCli("sethdseed", "true \"wifkey\"") + | ||||
HelpExampleRpc("sethdseed", "true, \"wifkey\"")); | HelpExampleRpc("sethdseed", "true, \"wifkey\"")); | ||||
} | } | ||||
if (IsInitialBlockDownload()) { | if (IsInitialBlockDownload()) { | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |