Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
#include <base58.h>#include <chain.h>#include <rpc/safemode.h>#include <rpc/server.h>#include <validation.h>#include <script/script.h>#include <script/standard.h>#include <sync.h>#include <util.h>#include <utiltime.h>#include <wallet/wallet.h>#include <merkleblock.h>#include <core_io.h>#include <wallet/rpcwallet.h>#include <fstream>#include <stdint.h>#include <boost/algorithm/string.hpp>#include <boost/date_time/posix_time/posix_time.hpp>#include <univalue.h>
Include dependency graph for rpcdump.cpp:Go to the source code of this file.
Functions | |
| static std::string | EncodeDumpTime (int64_t nTime) |
| static int64_t | DecodeDumpTime (const std::string &str) |
| static std::string | EncodeDumpString (const std::string &str) |
| std::string | DecodeDumpString (const std::string &str) |
| UniValue | importprivkey (const JSONRPCRequest &request) |
| UniValue | abortrescan (const JSONRPCRequest &request) |
| void | ImportAddress (CWallet *, const CTxDestination &dest, const std::string &strLabel) |
| void | ImportScript (CWallet *const pwallet, const CScript &script, const std::string &strLabel, bool isRedeemScript) |
| UniValue | importaddress (const JSONRPCRequest &request) |
| UniValue | importprunedfunds (const JSONRPCRequest &request) |
| UniValue | removeprunedfunds (const JSONRPCRequest &request) |
| UniValue | importpubkey (const JSONRPCRequest &request) |
| UniValue | importwallet (const JSONRPCRequest &request) |
| UniValue | importelectrumwallet (const JSONRPCRequest &request) |
| UniValue | dumpprivkey (const JSONRPCRequest &request) |
| UniValue | dumphdinfo (const JSONRPCRequest &request) |
| UniValue | dumpwallet (const JSONRPCRequest &request) |
| UniValue | ProcessImport (CWallet *const pwallet, const UniValue &data, const int64_t timestamp) |
| int64_t | GetImportTimestamp (const UniValue &data, int64_t now) |
| UniValue | importmulti (const JSONRPCRequest &mainRequest) |
Function Documentation
◆ abortrescan()
| UniValue abortrescan | ( | const JSONRPCRequest & | request | ) |
Definition at line 163 of file rpcdump.cpp.
References CWallet::AbortRescan(), EnsureWalletIsAvailable(), JSONRPCRequest::fHelp, GetWalletForJSONRPCRequest(), HelpExampleCli(), HelpExampleRpc(), CWallet::IsAbortingRescan(), CWallet::IsScanning(), NullUniValue, ObserveSafeMode(), JSONRPCRequest::params, and UniValue::size().
◆ DecodeDumpString()
| std::string DecodeDumpString | ( | const std::string & | str | ) |
Definition at line 60 of file rpcdump.cpp.
Referenced by importwallet().
◆ DecodeDumpTime()
|
static |
Definition at line 35 of file rpcdump.cpp.
Referenced by importwallet().
◆ dumphdinfo()
| UniValue dumphdinfo | ( | const JSONRPCRequest & | request | ) |
Definition at line 773 of file rpcdump.cpp.
References CWallet::cs_wallet, EnsureWalletIsAvailable(), EnsureWalletIsUnlocked(), JSONRPCRequest::fHelp, CWallet::GetDecryptedHDChain(), CCryptoKeyStore::GetHDChain(), CHDChain::GetMnemonic(), CHDChain::GetSeed(), GetWalletForJSONRPCRequest(), HelpExampleCli(), HelpExampleRpc(), HexStr(), JSONRPCError(), LOCK, NullUniValue, Pair(), JSONRPCRequest::params, UniValue::push_back(), RPC_INTERNAL_ERROR, RPC_WALLET_ERROR, UniValue::size(), and UniValue::VOBJ.
◆ dumpprivkey()
| UniValue dumpprivkey | ( | const JSONRPCRequest & | request | ) |
Definition at line 731 of file rpcdump.cpp.
References cs_main, CWallet::cs_wallet, DecodeDestination(), EnsureWalletIsAvailable(), EnsureWalletIsUnlocked(), JSONRPCRequest::fHelp, UniValue::get_str(), CWallet::GetKey(), GetWalletForJSONRPCRequest(), HelpExampleCli(), HelpExampleRpc(), IsValidDestination(), JSONRPCError(), LOCK2, NullUniValue, JSONRPCRequest::params, RPC_INVALID_ADDRESS_OR_KEY, RPC_TYPE_ERROR, RPC_WALLET_ERROR, UniValue::size(), and CBase58Data::ToString().
◆ dumpwallet()
| UniValue dumpwallet | ( | const JSONRPCRequest & | request | ) |
Definition at line 817 of file rpcdump.cpp.
References _(), prevector< N, T, Size, Diff >::begin(), chainActive, CLIENT_BUILD, CHDChain::CountAccounts(), cs_main, CWallet::cs_wallet, EncodeDestination(), EncodeDumpString(), EncodeDumpTime(), prevector< N, T, Size, Diff >::end(), EnsureWalletIsAvailable(), EnsureWalletIsUnlocked(), JSONRPCRequest::fHelp, UniValue::get_str(), CHDChain::GetAccount(), CWallet::GetAllReserveKeys(), CBlockIndex::GetBlockHash(), CBlockIndex::GetBlockTime(), CBasicKeyStore::GetCScript(), CBasicKeyStore::GetCScripts(), CWallet::GetDecryptedHDChain(), CCryptoKeyStore::GetHDChain(), CWallet::GetKey(), CWallet::GetKeyBirthTimes(), CHDChain::GetMnemonic(), CHDChain::GetSeed(), GetTime(), GetWalletForJSONRPCRequest(), CChain::Height(), HelpExampleCli(), HelpExampleRpc(), HexStr(), JSONRPCError(), LOCK2, CWallet::m_script_metadata, CWallet::mapAddressBook, CWallet::mapHdPubKeys, CExtKey::Neuter(), CHDAccount::nExternalChainCounter, CHDAccount::nInternalChainCounter, NullUniValue, Pair(), JSONRPCRequest::params, UniValue::push_back(), RPC_INTERNAL_ERROR, RPC_INVALID_PARAMETER, CBitcoinExtKeyBase< K, Size, Type >::SetKey(), CExtKey::SetMaster(), UniValue::size(), strprintf, CChain::Tip(), base_blob< BITS >::ToString(), CBase58Data::ToString(), and UniValue::VOBJ.
Referenced by BOOST_FIXTURE_TEST_CASE().
◆ EncodeDumpString()
|
static |
◆ EncodeDumpTime()
|
static |
Definition at line 31 of file rpcdump.cpp.
References DateTimeStrFormat().
Referenced by dumpwallet().
◆ GetImportTimestamp()
| int64_t GetImportTimestamp | ( | const UniValue & | data, |
| int64_t | now | ||
| ) |
Definition at line 1292 of file rpcdump.cpp.
References UniValue::exists(), UniValue::get_int64(), UniValue::get_str(), UniValue::isNum(), UniValue::isStr(), JSONRPCError(), RPC_TYPE_ERROR, strprintf, UniValue::type(), and uvTypeName().
Referenced by importmulti().
◆ ImportAddress()
| void ImportAddress | ( | CWallet * | pwallet, |
| const CTxDestination & | dest, | ||
| const std::string & | strLabel | ||
| ) |
Definition at line 215 of file rpcdump.cpp.
References GetScriptForDestination(), ImportScript(), IsValidDestination(), and CWallet::SetAddressBook().
Referenced by importaddress(), importpubkey(), and ImportScript().
◆ importaddress()
| UniValue importaddress | ( | const JSONRPCRequest & | request | ) |
Definition at line 224 of file rpcdump.cpp.
References cs_main, CWallet::cs_wallet, DecodeDestination(), EnsureWalletIsAvailable(), JSONRPCRequest::fHelp, fPruneMode, UniValue::get_bool(), UniValue::get_str(), GetWalletForJSONRPCRequest(), HelpExampleCli(), HelpExampleRpc(), ImportAddress(), ImportScript(), IsHex(), UniValue::isNull(), IsValidDestination(), JSONRPCError(), LOCK2, NullUniValue, JSONRPCRequest::params, ParseHex(), CWallet::ReacceptWalletTransactions(), CWallet::RescanFromTime(), WalletRescanReserver::reserve(), RPC_INVALID_ADDRESS_OR_KEY, RPC_WALLET_ERROR, UniValue::size(), and TIMESTAMP_MIN.
◆ importelectrumwallet()
| UniValue importelectrumwallet | ( | const JSONRPCRequest & | request | ) |
Definition at line 593 of file rpcdump.cpp.
References _(), CWallet::AddKeyPubKey(), chainActive, cs_main, CWallet::cs_wallet, EncodeDestination(), EnsureWalletIsAvailable(), EnsureWalletIsUnlocked(), JSONRPCRequest::fHelp, fPruneMode, UniValue::get_int(), UniValue::get_str(), CPubKey::GetID(), CBitcoinSecret::GetKey(), UniValue::getKeys(), CKey::GetPubKey(), GetWalletForJSONRPCRequest(), CWallet::HaveKey(), CChain::Height(), HelpExampleCli(), HelpExampleRpc(), UniValue::isNull(), JSONRPCError(), LOCK2, LogPrintf, NullUniValue, JSONRPCRequest::params, UniValue::read(), RPC_INVALID_PARAMETER, RPC_TYPE_ERROR, RPC_WALLET_ERROR, CWallet::ScanForWalletTransactions(), CBitcoinSecret::SetString(), CWallet::ShowProgress, UniValue::size(), CWallet::UpdateTimeFirstKey(), CKey::VerifyPubKey(), and UniValue::VOBJ.
◆ importmulti()
| UniValue importmulti | ( | const JSONRPCRequest & | mainRequest | ) |
Definition at line 1306 of file rpcdump.cpp.
References chainActive, UniValue::clear(), cs_main, CWallet::cs_wallet, EnsureWalletIsAvailable(), EnsureWalletIsUnlocked(), UniValue::exists(), JSONRPCRequest::fHelp, UniValue::get_bool(), CBlockIndex::GetBlockTime(), GetImportTimestamp(), CBlockIndex::GetMedianTimePast(), UniValue::getValues(), GetWalletForJSONRPCRequest(), HelpExampleCli(), UniValue::isNull(), JSONRPCError(), LOCK2, NullUniValue, JSONRPCRequest::params, ProcessImport(), UniValue::push_back(), UniValue::pushKV(), CWallet::ReacceptWalletTransactions(), CWallet::RescanFromTime(), WalletRescanReserver::reserve(), RPC_MISC_ERROR, RPC_WALLET_ERROR, RPCTypeCheck(), UniValue::setArray(), UniValue::size(), strprintf, TIMESTAMP_WINDOW, CChain::Tip(), UniValue::VARR, and UniValue::VOBJ.
Referenced by BOOST_FIXTURE_TEST_CASE().
◆ importprivkey()
| UniValue importprivkey | ( | const JSONRPCRequest & | request | ) |
Definition at line 74 of file rpcdump.cpp.
References CWallet::AddKeyPubKey(), cs_main, CWallet::cs_wallet, EnsureWalletIsAvailable(), EnsureWalletIsUnlocked(), JSONRPCRequest::fHelp, fPruneMode, UniValue::get_bool(), UniValue::get_str(), CPubKey::GetID(), CBitcoinSecret::GetKey(), CKey::GetPubKey(), GetWalletForJSONRPCRequest(), CWallet::HaveKey(), HelpExampleCli(), HelpExampleRpc(), UniValue::isNull(), CKey::IsValid(), JSONRPCError(), LOCK2, CWallet::mapKeyMetadata, CWallet::MarkDirty(), NullUniValue, JSONRPCRequest::params, CWallet::RescanFromTime(), WalletRescanReserver::reserve(), RPC_INVALID_ADDRESS_OR_KEY, RPC_WALLET_ERROR, CWallet::SetAddressBook(), CBitcoinSecret::SetString(), UniValue::size(), TIMESTAMP_MIN, CWallet::UpdateTimeFirstKey(), and CKey::VerifyPubKey().
◆ importprunedfunds()
| UniValue importprunedfunds | ( | const JSONRPCRequest & | request | ) |
Definition at line 302 of file rpcdump.cpp.
References CWallet::AddToWallet(), chainActive, CChain::Contains(), cs_main, CWallet::cs_wallet, DecodeHexTx(), EnsureWalletIsAvailable(), JSONRPCRequest::fHelp, UniValue::get_str(), CMutableTransaction::GetHash(), GetWalletForJSONRPCRequest(), CMerkleTx::hashBlock, CWallet::IsMine(), JSONRPCError(), LOCK, LOCK2, MakeTransactionRef(), mapBlockIndex, CMerkleTx::nIndex, NullUniValue, JSONRPCRequest::params, ParseHexV(), PROTOCOL_VERSION, RPC_DESERIALIZATION_ERROR, RPC_INVALID_ADDRESS_OR_KEY, SER_NETWORK, UniValue::size(), and CMerkleTx::tx.
◆ importpubkey()
| UniValue importpubkey | ( | const JSONRPCRequest & | request | ) |
Definition at line 401 of file rpcdump.cpp.
References cs_main, CWallet::cs_wallet, EnsureWalletIsAvailable(), JSONRPCRequest::fHelp, fPruneMode, UniValue::get_bool(), UniValue::get_str(), GetScriptForRawPubKey(), GetWalletForJSONRPCRequest(), HelpExampleCli(), HelpExampleRpc(), ImportAddress(), ImportScript(), IsHex(), UniValue::isNull(), JSONRPCError(), LOCK2, NullUniValue, JSONRPCRequest::params, ParseHex(), CWallet::ReacceptWalletTransactions(), CWallet::RescanFromTime(), WalletRescanReserver::reserve(), RPC_INVALID_ADDRESS_OR_KEY, RPC_WALLET_ERROR, UniValue::size(), and TIMESTAMP_MIN.
◆ ImportScript()
| void ImportScript | ( | CWallet *const | pwallet, |
| const CScript & | script, | ||
| const std::string & | strLabel, | ||
| bool | isRedeemScript | ||
| ) |
Definition at line 190 of file rpcdump.cpp.
References CWallet::AddCScript(), CWallet::AddWatchOnly(), ExtractDestination(), CBasicKeyStore::HaveCScript(), CBasicKeyStore::HaveWatchOnly(), ImportAddress(), IsMine(), ISMINE_SPENDABLE, JSONRPCError(), CWallet::MarkDirty(), RPC_WALLET_ERROR, and CWallet::SetAddressBook().
Referenced by ImportAddress(), importaddress(), and importpubkey().
◆ importwallet()
| UniValue importwallet | ( | const JSONRPCRequest & | request | ) |
Definition at line 468 of file rpcdump.cpp.
References _(), CWallet::AddCScript(), CWallet::AddKeyPubKey(), chainActive, cs_main, CWallet::cs_wallet, DecodeDumpString(), DecodeDumpTime(), EncodeDestination(), EnsureWalletIsAvailable(), EnsureWalletIsUnlocked(), JSONRPCRequest::fHelp, fPruneMode, UniValue::get_str(), CBlockIndex::GetBlockTime(), CPubKey::GetID(), CBitcoinSecret::GetKey(), CKey::GetPubKey(), GetWalletForJSONRPCRequest(), CBasicKeyStore::HaveCScript(), CWallet::HaveKey(), HelpExampleCli(), HelpExampleRpc(), IsHex(), JSONRPCError(), LOCK2, LogPrintf, CWallet::m_script_metadata, CWallet::mapKeyMetadata, CWallet::MarkDirty(), NullUniValue, JSONRPCRequest::params, ParseHex(), CWallet::RescanFromTime(), WalletRescanReserver::reserve(), RPC_INVALID_PARAMETER, RPC_WALLET_ERROR, CWallet::SetAddressBook(), CBitcoinSecret::SetString(), CWallet::ShowProgress, UniValue::size(), CChain::Tip(), CWallet::UpdateTimeFirstKey(), and CKey::VerifyPubKey().
Referenced by BOOST_FIXTURE_TEST_CASE().
◆ ProcessImport()
Definition at line 979 of file rpcdump.cpp.
References CWallet::AddCScript(), CWallet::AddKeyPubKey(), CWallet::AddWatchOnly(), DecodeDestination(), UniValue::exists(), ExtractDestination(), UniValue::get_array(), UniValue::get_bool(), UniValue::get_str(), CPubKey::GetID(), CBitcoinSecret::GetKey(), CKey::GetPubKey(), GetScriptForDestination(), GetScriptForRawPubKey(), UniValue::getType(), CBasicKeyStore::HaveCScript(), CWallet::HaveKey(), IsHex(), IsMine(), ISMINE_SPENDABLE, CScript::IsPayToScriptHash(), CKey::IsValid(), IsValidDestination(), JSONRPCError(), CWallet::mapKeyMetadata, CWallet::MarkDirty(), ParseHex(), UniValue::pushKV(), RPC_INVALID_ADDRESS_OR_KEY, RPC_INVALID_PARAMETER, RPC_MISC_ERROR, RPC_WALLET_ERROR, CWallet::SetAddressBook(), CBitcoinSecret::SetString(), UniValue::size(), CWallet::UpdateTimeFirstKey(), CKey::VerifyPubKey(), UniValue::VOBJ, and UniValue::VSTR.
Referenced by importmulti().
◆ removeprunedfunds()
| UniValue removeprunedfunds | ( | const JSONRPCRequest & | request | ) |
Definition at line 363 of file rpcdump.cpp.
References cs_main, CWallet::cs_wallet, DB_LOAD_OK, EnsureWalletIsAvailable(), JSONRPCRequest::fHelp, UniValue::get_str(), GetWalletForJSONRPCRequest(), HelpExampleCli(), HelpExampleRpc(), JSONRPCError(), LOCK2, NullUniValue, JSONRPCRequest::params, RPC_INVALID_PARAMETER, RPC_WALLET_ERROR, base_blob< BITS >::SetHex(), UniValue::size(), and CWallet::ZapSelectTx().

