Bitcoin ABC  0.22.13
P2P Digital Currency
Classes | Enumerations | Functions | Variables
rpcdump.cpp File Reference
#include <chain.h>
#include <config.h>
#include <core_io.h>
#include <interfaces/chain.h>
#include <key_io.h>
#include <merkleblock.h>
#include <rpc/server.h>
#include <rpc/util.h>
#include <script/descriptor.h>
#include <script/script.h>
#include <script/standard.h>
#include <sync.h>
#include <util/bip32.h>
#include <util/system.h>
#include <util/time.h>
#include <util/translation.h>
#include <wallet/rpcwallet.h>
#include <wallet/wallet.h>
#include <boost/algorithm/string.hpp>
#include <cstdint>
#include <tuple>
Include dependency graph for rpcdump.cpp:

Go to the source code of this file.

Classes

struct  ImportData
 

Enumerations

enum  ScriptContext { ScriptContext::TOP, ScriptContext::P2SH }
 

Functions

static std::string EncodeDumpString (const std::string &str)
 
static std::string DecodeDumpString (const std::string &str)
 
static bool GetWalletAddressesForKey (const Config &config, LegacyScriptPubKeyMan *spk_man, const CWallet *const pwallet, const CKeyID &keyid, std::string &strAddr, std::string &strLabel) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet)
 
static void RescanWallet (CWallet &wallet, const WalletRescanReserver &reserver, int64_t time_begin=TIMESTAMP_MIN, bool update=true)
 
UniValue importprivkey (const Config &config, const JSONRPCRequest &request)
 
UniValue abortrescan (const Config &config, const JSONRPCRequest &request)
 
UniValue importaddress (const Config &config, const JSONRPCRequest &request)
 
UniValue importprunedfunds (const Config &config, const JSONRPCRequest &request)
 
UniValue removeprunedfunds (const Config &config, const JSONRPCRequest &request)
 
UniValue importpubkey (const Config &config, const JSONRPCRequest &request)
 
UniValue importwallet (const Config &config, const JSONRPCRequest &request)
 
UniValue dumpprivkey (const Config &config, const JSONRPCRequest &request)
 
UniValue dumpwallet (const Config &config, const JSONRPCRequest &request)
 
static UniValue dumpcoins (const Config &config, const JSONRPCRequest &request)
 
static std::string RecurseImportData (const CScript &script, ImportData &import_data, const ScriptContext script_ctx)
 
static UniValue ProcessImportLegacy (CWallet *const pwallet, ImportData &import_data, std::map< CKeyID, CPubKey > &pubkey_map, std::map< CKeyID, CKey > &privkey_map, std::set< CScript > &script_pub_keys, bool &have_solving_data, const UniValue &data, std::vector< CKeyID > &ordered_pubkeys)
 
static UniValue ProcessImportDescriptor (ImportData &import_data, std::map< CKeyID, CPubKey > &pubkey_map, std::map< CKeyID, CKey > &privkey_map, std::set< CScript > &script_pub_keys, bool &have_solving_data, const UniValue &data, std::vector< CKeyID > &ordered_pubkeys)
 
static UniValue ProcessImport (CWallet *const pwallet, const UniValue &data, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet)
 
static int64_t GetImportTimestamp (const UniValue &data, int64_t now)
 
UniValue importmulti (const Config &config, const JSONRPCRequest &mainRequest)
 
static UniValue ProcessDescriptorImport (CWallet *const pwallet, const UniValue &data, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet)
 
UniValue importdescriptors (const Config &config, const JSONRPCRequest &main_request)
 
Span< const CRPCCommandGetWalletDumpRPCCommands ()
 

Variables

static const int64_t TIMESTAMP_MIN = 0
 

Enumeration Type Documentation

◆ ScriptContext

enum ScriptContext
strong
Enumerator
TOP 

Top-level scriptPubKey.

P2SH 

P2SH redeemScript.

Definition at line 1106 of file rpcdump.cpp.

Function Documentation

◆ abortrescan()

UniValue abortrescan ( const Config config,
const JSONRPCRequest request 
)

Definition at line 218 of file rpcdump.cpp.

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

◆ DecodeDumpString()

static std::string DecodeDumpString ( const std::string &  str)
static

Definition at line 43 of file rpcdump.cpp.

Here is the caller graph for this function:

◆ dumpcoins()

static UniValue dumpcoins ( const Config config,
const JSONRPCRequest request 
)
static

Definition at line 1025 of file rpcdump.cpp.

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

◆ dumpprivkey()

UniValue dumpprivkey ( const Config config,
const JSONRPCRequest request 
)

Definition at line 815 of file rpcdump.cpp.

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

◆ dumpwallet()

UniValue dumpwallet ( const Config config,
const JSONRPCRequest request 
)

Prevent arbitrary files from being overwritten. There have been reports that users have overwritten wallet files this way: https://github.com/bitcoin/bitcoin/issues/9934 It may also avoid other security issues.

Definition at line 862 of file rpcdump.cpp.

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

◆ EncodeDumpString()

static std::string EncodeDumpString ( const std::string &  str)
static

Definition at line 31 of file rpcdump.cpp.

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

◆ GetImportTimestamp()

static int64_t GetImportTimestamp ( const UniValue data,
int64_t  now 
)
static

Definition at line 1579 of file rpcdump.cpp.

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

◆ GetWalletAddressesForKey()

static bool GetWalletAddressesForKey ( const Config config,
LegacyScriptPubKeyMan spk_man,
const CWallet *const  pwallet,
const CKeyID keyid,
std::string &  strAddr,
std::string &  strLabel 
) -> cs_wallet)
static

Definition at line 58 of file rpcdump.cpp.

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

◆ GetWalletDumpRPCCommands()

Span<const CRPCCommand> GetWalletDumpRPCCommands ( )

Definition at line 2315 of file rpcdump.cpp.

Here is the call graph for this function:

◆ importaddress()

UniValue importaddress ( const Config config,
const JSONRPCRequest request 
)

Definition at line 249 of file rpcdump.cpp.

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

◆ importdescriptors()

UniValue importdescriptors ( const Config config,
const JSONRPCRequest main_request 
)

Definition at line 2082 of file rpcdump.cpp.

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

◆ importmulti()

UniValue importmulti ( const Config config,
const JSONRPCRequest mainRequest 
)

Definition at line 1596 of file rpcdump.cpp.

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

◆ importprivkey()

UniValue importprivkey ( const Config config,
const JSONRPCRequest request 
)

Definition at line 100 of file rpcdump.cpp.

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

◆ importprunedfunds()

UniValue importprunedfunds ( const Config config,
const JSONRPCRequest request 
)

Definition at line 378 of file rpcdump.cpp.

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

◆ importpubkey()

UniValue importpubkey ( const Config config,
const JSONRPCRequest request 
)

Definition at line 506 of file rpcdump.cpp.

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

◆ importwallet()

UniValue importwallet ( const Config config,
const JSONRPCRequest request 
)

Definition at line 612 of file rpcdump.cpp.

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

◆ ProcessDescriptorImport()

static UniValue ProcessDescriptorImport ( CWallet *const  pwallet,
const UniValue data,
const int64_t  timestamp 
) -> cs_wallet)
static

Definition at line 1901 of file rpcdump.cpp.

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

◆ ProcessImport()

static UniValue ProcessImport ( CWallet *const  pwallet,
const UniValue data,
const int64_t  timestamp 
) -> cs_wallet)
static

Definition at line 1469 of file rpcdump.cpp.

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

◆ ProcessImportDescriptor()

static UniValue ProcessImportDescriptor ( ImportData import_data,
std::map< CKeyID, CPubKey > &  pubkey_map,
std::map< CKeyID, CKey > &  privkey_map,
std::set< CScript > &  script_pub_keys,
bool &  have_solving_data,
const UniValue data,
std::vector< CKeyID > &  ordered_pubkeys 
)
static

Definition at line 1356 of file rpcdump.cpp.

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

◆ ProcessImportLegacy()

static UniValue ProcessImportLegacy ( CWallet *const  pwallet,
ImportData import_data,
std::map< CKeyID, CPubKey > &  pubkey_map,
std::map< CKeyID, CKey > &  privkey_map,
std::set< CScript > &  script_pub_keys,
bool &  have_solving_data,
const UniValue data,
std::vector< CKeyID > &  ordered_pubkeys 
)
static

Definition at line 1169 of file rpcdump.cpp.

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

◆ RecurseImportData()

static std::string RecurseImportData ( const CScript script,
ImportData import_data,
const ScriptContext  script_ctx 
)
static

Definition at line 1116 of file rpcdump.cpp.

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

◆ removeprunedfunds()

UniValue removeprunedfunds ( const Config config,
const JSONRPCRequest request 
)

Definition at line 458 of file rpcdump.cpp.

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

◆ RescanWallet()

static void RescanWallet ( CWallet wallet,
const WalletRescanReserver reserver,
int64_t  time_begin = TIMESTAMP_MIN,
bool  update = true 
)
static

Definition at line 87 of file rpcdump.cpp.

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

Variable Documentation

◆ TIMESTAMP_MIN

const int64_t TIMESTAMP_MIN = 0
static

Definition at line 85 of file rpcdump.cpp.