Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

rpcwallet.cpp File Reference
#include <amount.h>
#include <base58.h>
#include <chain.h>
#include <consensus/validation.h>
#include <core_io.h>
#include <httpserver.h>
#include <keepass.h>
#include <net.h>
#include <policy/feerate.h>
#include <policy/fees.h>
#include <privatesend/privatesend-client.h>
#include <rpc/mining.h>
#include <rpc/safemode.h>
#include <rpc/server.h>
#include <rpc/util.h>
#include <timedata.h>
#include <txmempool.h>
#include <util.h>
#include <utilmoneystr.h>
#include <validation.h>
#include <wallet/coincontrol.h>
#include <wallet/wallet.h>
#include <wallet/walletdb.h>
#include <wallet/walletutil.h>
#include <init.h>
#include <llmq/quorums_chainlocks.h>
#include <llmq/quorums_instantsend.h>
#include <stdint.h>
#include <univalue.h>
#include <functional>
+ Include dependency graph for rpcwallet.cpp:

Go to the source code of this file.

Classes

struct  tallyitem
 

Functions

CWalletGetWalletForJSONRPCRequest (const JSONRPCRequest &request)
 Figures out what wallet, if any, to use for a JSONRPCRequest. More...
 
std::string HelpRequiringPassphrase (CWallet *const pwallet)
 
bool EnsureWalletIsAvailable (CWallet *const pwallet, bool avoidException)
 
void EnsureWalletIsUnlocked (CWallet *const pwallet)
 
void WalletTxToJSON (const CWalletTx &wtx, UniValue &entry)
 
std::string AccountFromValue (const UniValue &value)
 
UniValue getnewaddress (const JSONRPCRequest &request)
 
CTxDestination GetAccountDestination (CWallet *const pwallet, std::string strAccount, bool bForceNew=false)
 
UniValue getaccountaddress (const JSONRPCRequest &request)
 
UniValue getrawchangeaddress (const JSONRPCRequest &request)
 
UniValue setaccount (const JSONRPCRequest &request)
 
UniValue getaccount (const JSONRPCRequest &request)
 
UniValue getaddressesbyaccount (const JSONRPCRequest &request)
 
static void SendMoney (CWallet *const pwallet, const CTxDestination &address, CAmount nValue, bool fSubtractFeeFromAmount, CWalletTx &wtxNew, const CCoinControl &coin_control)
 
UniValue sendtoaddress (const JSONRPCRequest &request)
 
UniValue instantsendtoaddress (const JSONRPCRequest &request)
 
UniValue listaddressgroupings (const JSONRPCRequest &request)
 
UniValue listaddressbalances (const JSONRPCRequest &request)
 
UniValue signmessage (const JSONRPCRequest &request)
 
UniValue getreceivedbyaddress (const JSONRPCRequest &request)
 
UniValue getreceivedbyaccount (const JSONRPCRequest &request)
 
UniValue getbalance (const JSONRPCRequest &request)
 
UniValue getunconfirmedbalance (const JSONRPCRequest &request)
 
UniValue movecmd (const JSONRPCRequest &request)
 
UniValue sendfrom (const JSONRPCRequest &request)
 
UniValue sendmany (const JSONRPCRequest &request)
 
UniValue addmultisigaddress (const JSONRPCRequest &request)
 
UniValue ListReceived (CWallet *const pwallet, const UniValue &params, bool fByAccounts)
 
UniValue listreceivedbyaddress (const JSONRPCRequest &request)
 
UniValue listreceivedbyaccount (const JSONRPCRequest &request)
 
static void MaybePushAddress (UniValue &entry, const CTxDestination &dest)
 
void ListTransactions (CWallet *const pwallet, const CWalletTx &wtx, const std::string &strAccount, int nMinDepth, bool fLong, UniValue &ret, const isminefilter &filter)
 List transactions based on the given criteria. More...
 
void AcentryToJSON (const CAccountingEntry &acentry, const std::string &strAccount, UniValue &ret)
 
UniValue listtransactions (const JSONRPCRequest &request)
 
UniValue listaccounts (const JSONRPCRequest &request)
 
UniValue listsinceblock (const JSONRPCRequest &request)
 
UniValue gettransaction (const JSONRPCRequest &request)
 
UniValue abandontransaction (const JSONRPCRequest &request)
 
UniValue backupwallet (const JSONRPCRequest &request)
 
UniValue keypoolrefill (const JSONRPCRequest &request)
 
static void LockWallet (CWallet *pWallet)
 
UniValue walletpassphrase (const JSONRPCRequest &request)
 
UniValue walletpassphrasechange (const JSONRPCRequest &request)
 
UniValue walletlock (const JSONRPCRequest &request)
 
UniValue encryptwallet (const JSONRPCRequest &request)
 
UniValue lockunspent (const JSONRPCRequest &request)
 
UniValue listlockunspent (const JSONRPCRequest &request)
 
UniValue settxfee (const JSONRPCRequest &request)
 
UniValue setprivatesendrounds (const JSONRPCRequest &request)
 
UniValue setprivatesendamount (const JSONRPCRequest &request)
 
UniValue getwalletinfo (const JSONRPCRequest &request)
 
UniValue listwallets (const JSONRPCRequest &request)
 
UniValue keepass (const JSONRPCRequest &request)
 
UniValue loadwallet (const JSONRPCRequest &request)
 
UniValue resendwallettransactions (const JSONRPCRequest &request)
 
UniValue listunspent (const JSONRPCRequest &request)
 
UniValue fundrawtransaction (const JSONRPCRequest &request)
 
UniValue rescanblockchain (const JSONRPCRequest &request)
 
UniValue abortrescan (const JSONRPCRequest &request)
 
UniValue dumpprivkey (const JSONRPCRequest &request)
 
UniValue importprivkey (const JSONRPCRequest &request)
 
UniValue importaddress (const JSONRPCRequest &request)
 
UniValue importpubkey (const JSONRPCRequest &request)
 
UniValue dumpwallet (const JSONRPCRequest &request)
 
UniValue importwallet (const JSONRPCRequest &request)
 
UniValue importprunedfunds (const JSONRPCRequest &request)
 
UniValue removeprunedfunds (const JSONRPCRequest &request)
 
UniValue importmulti (const JSONRPCRequest &request)
 
UniValue dumphdinfo (const JSONRPCRequest &request)
 
UniValue importelectrumwallet (const JSONRPCRequest &request)
 
void RegisterWalletRPCCommands (CRPCTable &t)
 

Variables

static const std::string WALLET_ENDPOINT_BASE = "/wallet/"
 
static const CRPCCommand commands []
 

Function Documentation

◆ abandontransaction()

◆ abortrescan()

◆ AccountFromValue()

◆ AcentryToJSON()

◆ addmultisigaddress()

◆ backupwallet()

◆ dumphdinfo()

◆ dumpprivkey()

◆ dumpwallet()

UniValue dumpwallet ( const JSONRPCRequest request)

Definition at line 817 of file rpcdump.cpp.

◆ encryptwallet()

◆ EnsureWalletIsAvailable()

◆ EnsureWalletIsUnlocked()

◆ fundrawtransaction()

◆ getaccount()

◆ getaccountaddress()

◆ GetAccountDestination()

CTxDestination GetAccountDestination ( CWallet *const  pwallet,
std::string  strAccount,
bool  bForceNew = false 
)

◆ getaddressesbyaccount()

◆ getbalance()

◆ getnewaddress()

◆ getrawchangeaddress()

◆ getreceivedbyaccount()

◆ getreceivedbyaddress()

◆ gettransaction()

◆ getunconfirmedbalance()

◆ GetWalletForJSONRPCRequest()

CWallet* GetWalletForJSONRPCRequest ( const JSONRPCRequest request)

Figures out what wallet, if any, to use for a JSONRPCRequest.

Parameters
[in]requestJSONRPCRequest that wishes to access a wallet
Returns
nullptr if no wallet should be used, or a pointer to the CWallet

Definition at line 45 of file rpcwallet.cpp.

References JSONRPCRequest::fHelp, GetWallet(), GetWallets(), JSONRPCError(), RPC_WALLET_NOT_FOUND, JSONRPCRequest::URI, urlDecode(), and WALLET_ENDPOINT_BASE.

Referenced by abandontransaction(), abortrescan(), addmultisigaddress(), backupwallet(), createmultisig(), dumphdinfo(), dumpprivkey(), dumpwallet(), encryptwallet(), fundrawtransaction(), getaccount(), getaccountaddress(), getaddressesbyaccount(), getbalance(), getnewaddress(), getprivatesendinfo(), getrawchangeaddress(), getreceivedbyaccount(), getreceivedbyaddress(), gettransaction(), getunconfirmedbalance(), getwalletinfo(), importaddress(), importelectrumwallet(), importmulti(), importprivkey(), importprunedfunds(), importpubkey(), importwallet(), keepass(), keypoolrefill(), listaccounts(), listaddressbalances(), listaddressgroupings(), listlockunspent(), listreceivedbyaccount(), listreceivedbyaddress(), listsinceblock(), listtransactions(), listunspent(), lockunspent(), movecmd(), protx_info(), protx_list(), removeprunedfunds(), rescanblockchain(), resendwallettransactions(), sendfrom(), sendmany(), sendtoaddress(), setaccount(), setprivatesendamount(), setprivatesendrounds(), settxfee(), signmessage(), signrawtransaction(), validateaddress(), walletlock(), walletpassphrase(), and walletpassphrasechange().

◆ getwalletinfo()

◆ HelpRequiringPassphrase()

std::string HelpRequiringPassphrase ( CWallet *const  pwallet)

◆ importaddress()

◆ importelectrumwallet()

◆ importmulti()

UniValue importmulti ( const JSONRPCRequest request)

Definition at line 1306 of file rpcdump.cpp.

◆ importprivkey()

◆ importprunedfunds()

◆ importpubkey()

◆ importwallet()

UniValue importwallet ( const JSONRPCRequest request)

Definition at line 468 of file rpcdump.cpp.

◆ instantsendtoaddress()

UniValue instantsendtoaddress ( const JSONRPCRequest request)

Definition at line 517 of file rpcwallet.cpp.

References JSONRPCRequest::fHelp, LogPrintf, and sendtoaddress().

◆ keepass()

◆ keypoolrefill()

◆ listaccounts()

◆ listaddressbalances()

◆ listaddressgroupings()

◆ listlockunspent()

◆ ListReceived()

◆ listreceivedbyaccount()

◆ listreceivedbyaddress()

◆ listsinceblock()

◆ ListTransactions()

void ListTransactions ( CWallet *const  pwallet,
const CWalletTx wtx,
const std::string &  strAccount,
int  nMinDepth,
bool  fLong,
UniValue ret,
const isminefilter filter 
)

List transactions based on the given criteria.

Parameters
pwalletThe wallet.
wtxThe wallet transaction.
strAccountThe account, if any, or "*" for all.
nMinDepthThe minimum confirmation depth.
fLongWhether to include the JSON version of the transaction.
retThe UniValue into which the result is stored.
filterThe "is mine" filter bool.

Definition at line 1545 of file rpcwallet.cpp.

References CWalletTx::GetAmounts(), CMerkleTx::GetBlocksToMaturity(), CMerkleTx::GetDepthInMainChain(), CMerkleTx::isAbandoned(), CMerkleTx::IsCoinBase(), CWalletTx::IsFromMe(), CMerkleTx::IsLockedByInstantSend(), IsMine(), ISMINE_WATCH_ONLY, CWallet::mapAddressBook, CWalletTx::mapValue, MaybePushAddress(), Pair(), UniValue::push_back(), ValueFromAmount(), UniValue::VOBJ, and WalletTxToJSON().

Referenced by gettransaction(), listsinceblock(), and listtransactions().

◆ listtransactions()

◆ listunspent()

◆ listwallets()

◆ loadwallet()

◆ lockunspent()

◆ LockWallet()

static void LockWallet ( CWallet pWallet)
static

Definition at line 2230 of file rpcwallet.cpp.

References CWallet::cs_wallet, CCryptoKeyStore::Lock(), LOCK, and CWallet::nRelockTime.

Referenced by walletpassphrase().

◆ MaybePushAddress()

static void MaybePushAddress ( UniValue entry,
const CTxDestination dest 
)
static

Definition at line 1527 of file rpcwallet.cpp.

References EncodeDestination(), IsValidDestination(), Pair(), and UniValue::push_back().

Referenced by ListTransactions().

◆ movecmd()

◆ RegisterWalletRPCCommands()

void RegisterWalletRPCCommands ( CRPCTable t)

◆ removeprunedfunds()

◆ rescanblockchain()

◆ resendwallettransactions()

◆ sendfrom()

◆ sendmany()

◆ SendMoney()

◆ sendtoaddress()

◆ setaccount()

◆ setprivatesendamount()

◆ setprivatesendrounds()

◆ settxfee()

◆ signmessage()

◆ walletlock()

◆ walletpassphrase()

◆ walletpassphrasechange()

◆ WalletTxToJSON()

Variable Documentation

◆ commands

const CRPCCommand commands[]
static

Definition at line 3522 of file rpcwallet.cpp.

Referenced by RegisterWalletRPCCommands().

◆ WALLET_ENDPOINT_BASE

const std::string WALLET_ENDPOINT_BASE = "/wallet/"
static

Definition at line 43 of file rpcwallet.cpp.

Referenced by GetWalletForJSONRPCRequest().

Released under the MIT license