Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 2,966 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
"DEPRECATED. Identical to " | "DEPRECATED. Identical to " | ||||
"getbalances().mine.untrusted_pending"}, | "getbalances().mine.untrusted_pending"}, | ||||
{RPCResult::Type::STR_AMOUNT, "immature_balance", | {RPCResult::Type::STR_AMOUNT, "immature_balance", | ||||
"DEPRECATED. Identical to getbalances().mine.immature"}, | "DEPRECATED. Identical to getbalances().mine.immature"}, | ||||
{RPCResult::Type::NUM, "txcount", | {RPCResult::Type::NUM, "txcount", | ||||
"the total number of transactions in the wallet"}, | "the total number of transactions in the wallet"}, | ||||
{RPCResult::Type::NUM_TIME, "keypoololdest", | {RPCResult::Type::NUM_TIME, "keypoololdest", | ||||
"the " + UNIX_EPOCH_TIME + | "the " + UNIX_EPOCH_TIME + | ||||
" of the oldest pre-generated key in the key pool"}, | " of the oldest pre-generated key in the key pool. Legacy " | ||||
"wallets only."}, | |||||
{RPCResult::Type::NUM, "keypoolsize", | {RPCResult::Type::NUM, "keypoolsize", | ||||
"how many new keys are pre-generated (only counts external " | "how many new keys are pre-generated (only counts external " | ||||
"keys)"}, | "keys)"}, | ||||
{RPCResult::Type::NUM, "keypoolsize_hd_internal", | {RPCResult::Type::NUM, "keypoolsize_hd_internal", | ||||
"how many new keys are pre-generated for internal use (used " | "how many new keys are pre-generated for internal use (used " | ||||
"for change outputs, only appears if the wallet is using this " | "for change outputs, only appears if the wallet is using this " | ||||
"feature, otherwise external keys are used)"}, | "feature, otherwise external keys are used)"}, | ||||
{RPCResult::Type::NUM_TIME, "unlocked_until", | {RPCResult::Type::NUM_TIME, "unlocked_until", | ||||
Show All 36 Lines | static UniValue getwalletinfo(const Config &config, | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK(pwallet->cs_wallet); | LOCK(pwallet->cs_wallet); | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
size_t kpExternalSize = pwallet->KeypoolCountExternalKeys(); | size_t kpExternalSize = pwallet->KeypoolCountExternalKeys(); | ||||
const auto bal = pwallet->GetBalance(); | const auto bal = pwallet->GetBalance(); | ||||
int64_t kp_oldest = pwallet->GetOldestKeyPoolTime(); | |||||
obj.pushKV("walletname", pwallet->GetName()); | obj.pushKV("walletname", pwallet->GetName()); | ||||
obj.pushKV("walletversion", pwallet->GetVersion()); | obj.pushKV("walletversion", pwallet->GetVersion()); | ||||
obj.pushKV("balance", ValueFromAmount(bal.m_mine_trusted)); | obj.pushKV("balance", ValueFromAmount(bal.m_mine_trusted)); | ||||
obj.pushKV("unconfirmed_balance", | obj.pushKV("unconfirmed_balance", | ||||
ValueFromAmount(bal.m_mine_untrusted_pending)); | ValueFromAmount(bal.m_mine_untrusted_pending)); | ||||
obj.pushKV("immature_balance", ValueFromAmount(bal.m_mine_immature)); | obj.pushKV("immature_balance", ValueFromAmount(bal.m_mine_immature)); | ||||
obj.pushKV("txcount", (int)pwallet->mapWallet.size()); | obj.pushKV("txcount", (int)pwallet->mapWallet.size()); | ||||
obj.pushKV("keypoololdest", pwallet->GetOldestKeyPoolTime()); | if (kp_oldest > 0) { | ||||
obj.pushKV("keypoololdest", kp_oldest); | |||||
} | |||||
obj.pushKV("keypoolsize", (int64_t)kpExternalSize); | obj.pushKV("keypoolsize", (int64_t)kpExternalSize); | ||||
LegacyScriptPubKeyMan *spk_man = pwallet->GetLegacyScriptPubKeyMan(); | LegacyScriptPubKeyMan *spk_man = pwallet->GetLegacyScriptPubKeyMan(); | ||||
if (spk_man) { | if (spk_man) { | ||||
CKeyID seed_id = spk_man->GetHDChain().seed_id; | CKeyID seed_id = spk_man->GetHDChain().seed_id; | ||||
if (!seed_id.IsNull()) { | if (!seed_id.IsNull()) { | ||||
obj.pushKV("hdseedid", seed_id.GetHex()); | obj.pushKV("hdseedid", seed_id.GetHex()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,003 Lines • Show Last 20 Lines |