BSHA3  0.17.99
P2P Blockchain, based on Bitcoin
Classes | Functions | Variables
rpcwallet.cpp File Reference
#include <amount.h>
#include <chain.h>
#include <consensus/validation.h>
#include <core_io.h>
#include <httpserver.h>
#include <validation.h>
#include <key_io.h>
#include <net.h>
#include <outputtype.h>
#include <policy/feerate.h>
#include <policy/fees.h>
#include <policy/policy.h>
#include <policy/rbf.h>
#include <rpc/mining.h>
#include <rpc/rawtransaction.h>
#include <rpc/server.h>
#include <rpc/util.h>
#include <script/sign.h>
#include <shutdown.h>
#include <timedata.h>
#include <util.h>
#include <utilmoneystr.h>
#include <wallet/coincontrol.h>
#include <wallet/feebumper.h>
#include <wallet/rpcwallet.h>
#include <wallet/wallet.h>
#include <wallet/walletdb.h>
#include <wallet/walletutil.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
 
class  DescribeWalletAddressVisitor
 

Functions

bool GetWalletNameFromJSONRPCRequest (const JSONRPCRequest &request, std::string &wallet_name)
 
std::shared_ptr< 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)
 
 if (!params[0].isNull()) nMinDepth
 
 if (!params[1].isNull()) fIncludeEmpty
 
 if (!params[2].isNull()) if(params[2].get_bool()) filter
 
 if (!by_label &&params.size() > 3)
 
 for (const std::pair< const uint256, CWalletTx > &pairWtx :pwallet->mapWallet)
 
 if (has_filtered_address)
 
 for (auto item_it=start;item_it !=end;++item_it)
 
 if (by_label)
 
UniValue listtransactions (const JSONRPCRequest &request)
 
void FundTransaction (CWallet *const pwallet, CMutableTransaction &tx, CAmount &fee_out, int &change_position, UniValue options)
 
UniValue signrawtransactionwithwallet (const JSONRPCRequest &request)
 
UniValue generate (const JSONRPCRequest &request)
 
UniValue rescanblockchain (const JSONRPCRequest &request)
 
UniValue getaddressinfo (const JSONRPCRequest &request)
 
UniValue sethdseed (const JSONRPCRequest &request)
 
void AddKeypathToMap (const CWallet *pwallet, const CKeyID &keyID, std::map< CPubKey, KeyOriginInfo > &hd_keypaths)
 
bool FillPSBT (const CWallet *pwallet, PartiallySignedTransaction &psbtx, const CTransaction *txConst, int sighash_type, bool sign, bool bip32derivs)
 
UniValue walletprocesspsbt (const JSONRPCRequest &request)
 
UniValue walletcreatefundedpsbt (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)
 
void RegisterWalletRPCCommands (CRPCTable &t)
 

Variables

static UniValue pwallet cs_wallet
 
bool fIncludeEmpty = false
 
isminefilter filter = ISMINE_SPENDABLE
 
bool has_filtered_address = false
 
CTxDestination filtered_address = CNoDestination()
 
std::map< CTxDestination, tallyitemmapTally
 
UniValue ret (UniValue::VARR)
 
std::map< std::string, tallyitemlabel_tally
 
auto start = pwallet->mapAddressBook.begin()
 
auto end = pwallet->mapAddressBook.end()
 

Function Documentation

◆ abortrescan()

UniValue abortrescan ( const JSONRPCRequest request)

Definition at line 191 of file rpcdump.cpp.

Here is the call graph for this function:

◆ AddKeypathToMap()

void AddKeypathToMap ( const CWallet pwallet,
const CKeyID keyID,
std::map< CPubKey, KeyOriginInfo > &  hd_keypaths 
)

Definition at line 3725 of file rpcwallet.cpp.

Here is the call graph for this function:

◆ dumpprivkey()

UniValue dumpprivkey ( const JSONRPCRequest request)

Definition at line 633 of file rpcdump.cpp.

Here is the call graph for this function:

◆ dumpwallet()

UniValue dumpwallet ( const JSONRPCRequest request)

Definition at line 677 of file rpcdump.cpp.

◆ EnsureWalletIsAvailable()

bool EnsureWalletIsAvailable ( CWallet *const  pwallet,
bool  avoidException 
)

Definition at line 73 of file rpcwallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnsureWalletIsUnlocked()

void EnsureWalletIsUnlocked ( CWallet *const  pwallet)

Definition at line 85 of file rpcwallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillPSBT()

bool FillPSBT ( const CWallet pwallet,
PartiallySignedTransaction psbtx,
const CTransaction txConst,
int  sighash_type,
bool  sign,
bool  bip32derivs 
)

Definition at line 3738 of file rpcwallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ for() [1/2]

for ( const std::pair< const uint256, CWalletTx > &pairWtx :pwallet->  mapWallet)

Definition at line 1028 of file rpcwallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ for() [2/2]

for ( auto  item_it = start; item_it != end; ++item_it)

Definition at line 1077 of file rpcwallet.cpp.

Here is the call graph for this function:

◆ FundTransaction()

void FundTransaction ( CWallet *const  pwallet,
CMutableTransaction tx,
CAmount fee_out,
int &  change_position,
UniValue  options 
)

Definition at line 2750 of file rpcwallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate()

UniValue generate ( const JSONRPCRequest request)

Definition at line 3178 of file rpcwallet.cpp.

Here is the call graph for this function:

◆ getaddressinfo()

UniValue getaddressinfo ( const JSONRPCRequest request)

Definition at line 3437 of file rpcwallet.cpp.

Here is the call graph for this function:

◆ GetWalletForJSONRPCRequest()

std::shared_ptr<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 53 of file rpcwallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetWalletNameFromJSONRPCRequest()

bool GetWalletNameFromJSONRPCRequest ( const JSONRPCRequest request,
std::string &  wallet_name 
)

Definition at line 43 of file rpcwallet.cpp.

Here is the caller graph for this function:

◆ HelpRequiringPassphrase()

std::string HelpRequiringPassphrase ( CWallet *const  pwallet)

Definition at line 66 of file rpcwallet.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ if() [1/6]

if ( !params.  isNull()[0])
Here is the caller graph for this function:

◆ if() [2/6]

if ( !params.  isNull()[1])

◆ if() [3/6]

if ( !params.  isNull()[2])

◆ if() [4/6]

if ( !by_label &&params.  size(),
 
)

Definition at line 1018 of file rpcwallet.cpp.

Here is the call graph for this function:

◆ if() [5/6]

Definition at line 1070 of file rpcwallet.cpp.

◆ if() [6/6]

if ( by_label  )

Definition at line 1124 of file rpcwallet.cpp.

Here is the call graph for this function:

◆ importaddress()

UniValue importaddress ( const JSONRPCRequest request)

Definition at line 253 of file rpcdump.cpp.

Here is the call graph for this function:

◆ importmulti()

UniValue importmulti ( const JSONRPCRequest request)

Definition at line 1062 of file rpcdump.cpp.

◆ importprivkey()

UniValue importprivkey ( const JSONRPCRequest request)

Definition at line 100 of file rpcdump.cpp.

Here is the call graph for this function:

◆ importprunedfunds()

UniValue importprunedfunds ( const JSONRPCRequest request)

Definition at line 332 of file rpcdump.cpp.

Here is the call graph for this function:

◆ importpubkey()

UniValue importpubkey ( const JSONRPCRequest request)

Definition at line 433 of file rpcdump.cpp.

Here is the call graph for this function:

◆ importwallet()

UniValue importwallet ( const JSONRPCRequest request)

Definition at line 504 of file rpcdump.cpp.

◆ listtransactions()

UniValue listtransactions ( const JSONRPCRequest request)

Definition at line 1327 of file rpcwallet.cpp.

Here is the call graph for this function:

◆ RegisterWalletRPCCommands()

void RegisterWalletRPCCommands ( CRPCTable t)

Definition at line 4039 of file rpcwallet.cpp.

Here is the caller graph for this function:

◆ removeprunedfunds()

UniValue removeprunedfunds ( const JSONRPCRequest request)

Definition at line 395 of file rpcdump.cpp.

Here is the call graph for this function:

◆ rescanblockchain()

UniValue rescanblockchain ( const JSONRPCRequest request)

Definition at line 3231 of file rpcwallet.cpp.

Here is the call graph for this function:

◆ sethdseed()

UniValue sethdseed ( const JSONRPCRequest request)

Definition at line 3654 of file rpcwallet.cpp.

Here is the call graph for this function:

◆ signrawtransactionwithwallet()

UniValue signrawtransactionwithwallet ( const JSONRPCRequest request)

Definition at line 2955 of file rpcwallet.cpp.

Here is the call graph for this function:

◆ walletcreatefundedpsbt()

UniValue walletcreatefundedpsbt ( const JSONRPCRequest request)

Definition at line 3851 of file rpcwallet.cpp.

Here is the call graph for this function:

◆ walletprocesspsbt()

UniValue walletprocesspsbt ( const JSONRPCRequest request)

Definition at line 3782 of file rpcwallet.cpp.

Here is the call graph for this function:

Variable Documentation

◆ cs_wallet

UniValue pwallet cs_wallet
Initial value:
{
int nMinDepth = 1

Definition at line 1000 of file rpcwallet.cpp.

◆ end

auto end = pwallet->mapAddressBook.end()

Definition at line 1068 of file rpcwallet.cpp.

◆ filter

Definition at line 1011 of file rpcwallet.cpp.

◆ filtered_address

CTxDestination filtered_address = CNoDestination()

Definition at line 1017 of file rpcwallet.cpp.

◆ fIncludeEmpty

bool fIncludeEmpty = false

Definition at line 1007 of file rpcwallet.cpp.

◆ has_filtered_address

bool has_filtered_address = false

Definition at line 1016 of file rpcwallet.cpp.

◆ label_tally

std::map<std::string, tallyitem> label_tally

Definition at line 1063 of file rpcwallet.cpp.

◆ mapTally

std::map<CTxDestination, tallyitem> mapTally

Definition at line 1027 of file rpcwallet.cpp.

◆ ret

return ret

Definition at line 1140 of file rpcwallet.cpp.

◆ start

auto start = pwallet->mapAddressBook.begin()

Definition at line 1067 of file rpcwallet.cpp.