Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 2) { | ||||
}, | }, | ||||
RPCResult{"\"address\" (string) The new bitcoin address\n"}, | RPCResult{"\"address\" (string) The new bitcoin address\n"}, | ||||
RPCExamples{HelpExampleCli("getnewaddress", "") + | RPCExamples{HelpExampleCli("getnewaddress", "") + | ||||
HelpExampleRpc("getnewaddress", "")}, | HelpExampleRpc("getnewaddress", "")}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
// Belt and suspenders check for disabled private keys | |||||
if (pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) { | |||||
throw JSONRPCError(RPC_WALLET_ERROR, | |||||
"Error: Private keys are disabled for this wallet"); | |||||
} | |||||
LOCK(pwallet->cs_wallet); | LOCK(pwallet->cs_wallet); | ||||
if (!pwallet->CanGetAddresses()) { | if (!pwallet->CanGetAddresses()) { | ||||
throw JSONRPCError(RPC_WALLET_ERROR, | throw JSONRPCError(RPC_WALLET_ERROR, | ||||
"Error: This wallet has no available keys"); | "Error: This wallet has no available keys"); | ||||
} | } | ||||
// Parse the label first so we don't generate a key if there's an error | // Parse the label first so we don't generate a key if there's an error | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 1) { | ||||
{}, | {}, | ||||
RPCResult{"\"address\" (string) The address\n"}, | RPCResult{"\"address\" (string) The address\n"}, | ||||
RPCExamples{HelpExampleCli("getrawchangeaddress", "") + | RPCExamples{HelpExampleCli("getrawchangeaddress", "") + | ||||
HelpExampleRpc("getrawchangeaddress", "")}, | HelpExampleRpc("getrawchangeaddress", "")}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
// Belt and suspenders check for disabled private keys | |||||
if (pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) { | |||||
throw JSONRPCError(RPC_WALLET_ERROR, | |||||
"Error: Private keys are disabled for this wallet"); | |||||
} | |||||
LOCK(pwallet->cs_wallet); | LOCK(pwallet->cs_wallet); | ||||
if (!pwallet->CanGetAddresses(true)) { | if (!pwallet->CanGetAddresses(true)) { | ||||
throw JSONRPCError(RPC_WALLET_ERROR, | throw JSONRPCError(RPC_WALLET_ERROR, | ||||
"Error: This wallet has no available keys"); | "Error: This wallet has no available keys"); | ||||
} | } | ||||
if (!pwallet->IsLocked()) { | if (!pwallet->IsLocked()) { | ||||
▲ Show 20 Lines • Show All 2,691 Lines • ▼ Show 20 Lines | static UniValue getwalletinfo(const Config &config, | ||||
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()); | obj.pushKV("keypoololdest", pwallet->GetOldestKeyPoolTime()); | ||||
obj.pushKV("keypoolsize", (int64_t)kpExternalSize); | obj.pushKV("keypoolsize", (int64_t)kpExternalSize); | ||||
CKeyID seed_id = pwallet->GetHDChain().seed_id; | CKeyID seed_id = pwallet->GetHDChain().seed_id; | ||||
if (!seed_id.IsNull() && pwallet->CanSupportFeature(FEATURE_HD_SPLIT)) { | if (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()) { | ||||
▲ Show 20 Lines • Show All 1,841 Lines • Show Last 20 Lines |