|
| static void | WalletBalance (benchmark::Bench &bench, const bool set_dirty, const bool add_mine) |
| |
| static void | WalletBalanceDirty (benchmark::Bench &bench) |
| |
| static void | WalletBalanceClean (benchmark::Bench &bench) |
| |
| static void | WalletBalanceMine (benchmark::Bench &bench) |
| |
| static void | WalletBalanceWatch (benchmark::Bench &bench) |
| |
| | BENCHMARK (WalletBalanceDirty) |
| |
| | BENCHMARK (WalletBalanceClean) |
| |
| | BENCHMARK (WalletBalanceMine) |
| |
| | BENCHMARK (WalletBalanceWatch) |
| |
| static void | WalletCreate (benchmark::Bench &bench, bool encrypted) |
| |
| static void | WalletCreatePlain (benchmark::Bench &bench) |
| |
| static void | WalletCreateEncrypted (benchmark::Bench &bench) |
| |
| | BENCHMARK (WalletCreatePlain) |
| |
| | BENCHMARK (WalletCreateEncrypted) |
| |
| static void | WalletIsMine (benchmark::Bench &bench, int num_combo=0) |
| |
| static void | WalletIsMineDescriptors (benchmark::Bench &bench) |
| |
| static void | WalletIsMineMigratedDescriptors (benchmark::Bench &bench) |
| |
| | BENCHMARK (WalletIsMineDescriptors) |
| |
| | BENCHMARK (WalletIsMineMigratedDescriptors) |
| |
| static void | AddTx (CWallet &wallet) |
| |
| static void | WalletLoadingDescriptors (benchmark::Bench &bench) |
| |
| | BENCHMARK (WalletLoadingDescriptors) |
| |
| static void | WalletMigration (benchmark::Bench &bench) |
| |
| | BENCHMARK (WalletMigration) |
| |
| static util::Result< SelectionResult > | ErrorMaxWeightExceeded () |
| |
| util::Result< SelectionResult > | SelectCoinsBnB (std::vector< OutputGroup > &utxo_pool, const CAmount &selection_target, const CAmount &cost_of_change, int max_selection_weight) |
| |
| util::Result< SelectionResult > | CoinGrinder (std::vector< OutputGroup > &utxo_pool, const CAmount &selection_target, CAmount change_target, int max_selection_weight) |
| |
| util::Result< SelectionResult > | SelectCoinsSRD (const std::vector< OutputGroup > &utxo_pool, CAmount target_value, CAmount change_fee, FastRandomContext &rng, int max_selection_weight) |
| | Select coins by Single Random Draw (SRD).
|
| |
| static void | ApproximateBestSubset (FastRandomContext &insecure_rand, const std::vector< OutputGroup > &groups, const CAmount &nTotalLower, const CAmount &nTargetValue, std::vector< char > &vfBest, CAmount &nBest, int max_selection_weight, int iterations=1000) |
| | Find a subset of the OutputGroups that is at least as large as, but as close as possible to, the target amount; solve subset sum.
|
| |
| util::Result< SelectionResult > | KnapsackSolver (std::vector< OutputGroup > &groups, const CAmount &nTargetValue, CAmount change_target, FastRandomContext &rng, int max_selection_weight) |
| |
| CAmount | GenerateChangeTarget (CAmount payment_value, CAmount change_fee, FastRandomContext &rng) |
| | Choose a random change target for each transaction to make it harder to fingerprint the Core wallet based on the change output values of transactions it creates.
|
| |
| std::string | GetAlgorithmName (const SelectionAlgorithm algo) |
| |
| bool | EncryptSecret (const CKeyingMaterial &vMasterKey, const CKeyingMaterial &vchPlaintext, const uint256 &nIV, std::vector< unsigned char > &vchCiphertext) |
| |
| bool | DecryptSecret (const CKeyingMaterial &master_key, const std::span< const unsigned char > ciphertext, const uint256 &iv, CKeyingMaterial &plaintext) |
| |
| bool | DecryptKey (const CKeyingMaterial &master_key, const std::span< const unsigned char > crypted_secret, const CPubKey &pub_key, CKey &key) |
| |
| bool | operator< (BytePrefix a, std::span< const std::byte > b) |
| |
| bool | operator< (std::span< const std::byte > a, BytePrefix b) |
| |
| std::vector< std::pair< fs::path, std::string > > | ListDatabases (const fs::path &path) |
| | Recursively list database paths in directory.
|
| |
| fs::path | BDBDataFile (const fs::path &wallet_path) |
| |
| fs::path | SQLiteDataFile (const fs::path &path) |
| |
| bool | IsBDBFile (const fs::path &path) |
| |
| bool | IsSQLiteFile (const fs::path &path) |
| |
| void | ReadDatabaseArgs (const ArgsManager &args, DatabaseOptions &options) |
| |
| std::unique_ptr< WalletDatabase > | MakeDatabase (const fs::path &path, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error) |
| |
| bool | DumpWallet (const ArgsManager &args, WalletDatabase &db, bilingual_str &error) |
| |
| static void | WalletToolReleaseWallet (CWallet *wallet) |
| |
| bool | CreateFromDump (const ArgsManager &args, const std::string &name, const fs::path &wallet_path, bilingual_str &error, std::vector< bilingual_str > &warnings) |
| |
| static feebumper::Result | PreconditionChecks (const CWallet &wallet, const CWalletTx &wtx, bool require_mine, std::vector< bilingual_str > &errors) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| | Check whether transaction has descendant in wallet or mempool, or has been mined, or conflicts with a mined transaction.
|
| |
| static feebumper::Result | CheckFeeRate (const CWallet &wallet, const CMutableTransaction &mtx, const CFeeRate &newFeerate, const int64_t maxTxSize, CAmount old_fee, std::vector< bilingual_str > &errors) |
| | Check if the user provided a valid feeRate.
|
| |
| static CFeeRate | EstimateFeeRate (const CWallet &wallet, const CWalletTx &wtx, const CAmount old_fee, const CCoinControl &coin_control) |
| |
| CAmount | GetRequiredFee (const CWallet &wallet, unsigned int nTxBytes) |
| | Return the minimum required absolute fee for this size based on the required fee rate.
|
| |
| CAmount | GetMinimumFee (const CWallet &wallet, unsigned int nTxBytes, const CCoinControl &coin_control, FeeCalculation *feeCalc) |
| | Estimate the minimum fee considering user set parameters and the required fee.
|
| |
| CFeeRate | GetRequiredFeeRate (const CWallet &wallet) |
| | Return the minimum required feerate taking into account the minimum relay feerate and user set minimum transaction feerate.
|
| |
| CFeeRate | GetMinimumFeeRate (const CWallet &wallet, const CCoinControl &coin_control, FeeCalculation *feeCalc) |
| | Estimate the minimum fee rate considering user set parameters and the required fee.
|
| |
| CFeeRate | GetDiscardRate (const CWallet &wallet) |
| | Return the maximum feerate for discarding change.
|
| |
| bool | VerifyWallets (WalletContext &context) |
| | Responsible for reading and validating the -wallet arguments and verifying the wallet database.
|
| |
| bool | LoadWallets (WalletContext &context) |
| | Load wallet databases.
|
| |
| void | StartWallets (WalletContext &context) |
| | Complete startup of wallets.
|
| |
| void | UnloadWallets (WalletContext &context) |
| |
| static void | SeekToPage (AutoFile &s, uint32_t page_num, uint32_t page_size) |
| |
| std::unique_ptr< BerkeleyRODatabase > | MakeBerkeleyRODatabase (const fs::path &path, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error) |
| | Return object giving access to Berkeley Read Only database at specified path.
|
| |
| bool | InputIsMine (const CWallet &wallet, const CTxIn &txin) |
| |
| bool | AllInputsMine (const CWallet &wallet, const CTransaction &tx) |
| | Returns whether all of the inputs belong to the wallet.
|
| |
| CAmount | OutputGetCredit (const CWallet &wallet, const CTxOut &txout) |
| |
| CAmount | TxGetCredit (const CWallet &wallet, const CTransaction &tx) |
| |
| bool | ScriptIsChange (const CWallet &wallet, const CScript &script) |
| |
| bool | OutputIsChange (const CWallet &wallet, const CTxOut &txout) |
| |
| CAmount | OutputGetChange (const CWallet &wallet, const CTxOut &txout) |
| |
| CAmount | TxGetChange (const CWallet &wallet, const CTransaction &tx) |
| |
| static CAmount | GetCachableAmount (const CWallet &wallet, const CWalletTx &wtx, CWalletTx::AmountType type, bool avoid_reuse) |
| |
| CAmount | CachedTxGetCredit (const CWallet &wallet, const CWalletTx &wtx, bool avoid_reuse) |
| |
| CAmount | CachedTxGetDebit (const CWallet &wallet, const CWalletTx &wtx, bool avoid_reuse) |
| |
| CAmount | CachedTxGetChange (const CWallet &wallet, const CWalletTx &wtx) |
| |
| void | CachedTxGetAmounts (const CWallet &wallet, const CWalletTx &wtx, std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, bool include_change) |
| |
| bool | CachedTxIsFromMe (const CWallet &wallet, const CWalletTx &wtx) |
| |
| bool | CachedTxIsTrusted (const CWallet &wallet, const CWalletTx &wtx, std::set< Txid > &trusted_parents) |
| |
| bool | CachedTxIsTrusted (const CWallet &wallet, const CWalletTx &wtx) |
| |
| Balance | GetBalance (const CWallet &wallet, const int min_depth, bool avoid_reuse) |
| |
| std::map< CTxDestination, CAmount > | GetAddressBalances (const CWallet &wallet) |
| |
| std::set< std::set< CTxDestination > > | GetAddressGroupings (const CWallet &wallet) |
| |
| RPCHelpMan | getnewaddress () |
| |
| RPCHelpMan | getrawchangeaddress () |
| |
| RPCHelpMan | setlabel () |
| |
| RPCHelpMan | listaddressgroupings () |
| |
| RPCHelpMan | keypoolrefill () |
| |
| static UniValue | DescribeWalletAddress (const CWallet &wallet, const CTxDestination &dest) |
| |
| RPCHelpMan | getaddressinfo () |
| |
| RPCHelpMan | getaddressesbylabel () |
| |
| RPCHelpMan | listlabels () |
| |
| RPCHelpMan | walletdisplayaddress () |
| |
| RPCHelpMan | importprunedfunds () |
| |
| RPCHelpMan | removeprunedfunds () |
| |
| static int64_t | GetImportTimestamp (const UniValue &data, int64_t now) |
| |
| static UniValue | ProcessDescriptorImport (CWallet &wallet, const UniValue &data, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| |
| RPCHelpMan | importdescriptors () |
| |
| RPCHelpMan | listdescriptors () |
| |
| RPCHelpMan | backupwallet () |
| |
| RPCHelpMan | restorewallet () |
| |
| static CAmount | GetReceived (const CWallet &wallet, const UniValue ¶ms, bool by_label) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| |
| RPCHelpMan | getreceivedbyaddress () |
| |
| RPCHelpMan | getreceivedbylabel () |
| |
| RPCHelpMan | getbalance () |
| |
| RPCHelpMan | lockunspent () |
| |
| RPCHelpMan | listlockunspent () |
| |
| RPCHelpMan | getbalances () |
| |
| RPCHelpMan | listunspent () |
| |
| RPCHelpMan | walletpassphrase () |
| |
| RPCHelpMan | walletpassphrasechange () |
| |
| RPCHelpMan | walletlock () |
| |
| RPCHelpMan | encryptwallet () |
| |
| RPCHelpMan | signmessage () |
| |
| std::vector< CRecipient > | CreateRecipients (const std::vector< std::pair< CTxDestination, CAmount > > &outputs, const std::set< int > &subtract_fee_outputs) |
| |
| static void | InterpretFeeEstimationInstructions (const UniValue &conf_target, const UniValue &estimate_mode, const UniValue &fee_rate, UniValue &options) |
| |
| std::set< int > | InterpretSubtractFeeFromOutputInstructions (const UniValue &sffo_instructions, const std::vector< std::string > &destinations) |
| |
| static UniValue | FinishTransaction (const std::shared_ptr< CWallet > pwallet, const UniValue &options, CMutableTransaction &rawTx) |
| |
| static void | PreventOutdatedOptions (const UniValue &options) |
| |
| UniValue | SendMoney (CWallet &wallet, const CCoinControl &coin_control, std::vector< CRecipient > &recipients, mapValue_t map_value, bool verbose) |
| |
| static void | SetFeeEstimateMode (const CWallet &wallet, CCoinControl &cc, const UniValue &conf_target, const UniValue &estimate_mode, const UniValue &fee_rate, bool override_min_fee) |
| | Update coin control with fee estimation based on the given parameters.
|
| |
| RPCHelpMan | sendtoaddress () |
| |
| RPCHelpMan | sendmany () |
| |
| static std::vector< RPCArg > | FundTxDoc (bool solving_data=true) |
| |
| CreatedTransactionResult | FundTransaction (CWallet &wallet, const CMutableTransaction &tx, const std::vector< CRecipient > &recipients, const UniValue &options, CCoinControl &coinControl, bool override_min_fee) |
| |
| static void | SetOptionsInputWeights (const UniValue &inputs, UniValue &options) |
| |
| RPCHelpMan | fundrawtransaction () |
| |
| RPCHelpMan | signrawtransactionwithwallet () |
| |
| static std::vector< RPCArg > | OutputsDoc () |
| |
| static RPCHelpMan | bumpfee_helper (std::string method_name) |
| |
| RPCHelpMan | bumpfee () |
| |
| RPCHelpMan | psbtbumpfee () |
| |
| RPCHelpMan | send () |
| |
| RPCHelpMan | sendall () |
| |
| RPCHelpMan | walletprocesspsbt () |
| |
| RPCHelpMan | walletcreatefundedpsbt () |
| |
| static void | WalletTxToJSON (const CWallet &wallet, const CWalletTx &wtx, UniValue &entry) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| |
| static UniValue | ListReceived (const CWallet &wallet, const UniValue ¶ms, const bool by_label, const bool include_immature_coinbase) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| |
| RPCHelpMan | listreceivedbyaddress () |
| |
| RPCHelpMan | listreceivedbylabel () |
| |
| static void | MaybePushAddress (UniValue &entry, const CTxDestination &dest) |
| |
| template<class Vec > |
| static void | ListTransactions (const CWallet &wallet, const CWalletTx &wtx, int nMinDepth, bool fLong, Vec &ret, const std::optional< std::string > &filter_label, bool include_change=false) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| | List transactions based on the given criteria.
|
| |
| static std::vector< RPCResult > | TransactionDescriptionString () |
| |
| RPCHelpMan | listtransactions () |
| |
| RPCHelpMan | listsinceblock () |
| |
| RPCHelpMan | gettransaction () |
| |
| RPCHelpMan | abandontransaction () |
| |
| RPCHelpMan | rescanblockchain () |
| |
| RPCHelpMan | abortrescan () |
| |
| bool | GetAvoidReuseFlag (const CWallet &wallet, const UniValue ¶m) |
| |
| std::string | EnsureUniqueWalletName (const JSONRPCRequest &request, std::optional< std::string_view > wallet_name) |
| | Ensures that a wallet name is specified across the endpoint and wallet_name.
|
| |
| bool | GetWalletNameFromJSONRPCRequest (const JSONRPCRequest &request, std::string &wallet_name) |
| |
| std::shared_ptr< CWallet > | GetWalletForJSONRPCRequest (const JSONRPCRequest &request) |
| | Figures out what wallet, if any, to use for a JSONRPCRequest.
|
| |
| void | EnsureWalletIsUnlocked (const CWallet &wallet) |
| |
| WalletContext & | EnsureWalletContext (const std::any &context) |
| |
| std::string | LabelFromValue (const UniValue &value) |
| |
| void | PushParentDescriptors (const CWallet &wallet, const CScript &script_pubkey, UniValue &entry) |
| | Fetch parent descriptors of this scriptPubKey.
|
| |
| void | HandleWalletError (const std::shared_ptr< CWallet > &wallet, DatabaseStatus &status, bilingual_str &error) |
| |
| void | AppendLastProcessedBlock (UniValue &entry, const CWallet &wallet) |
| |
| static RPCHelpMan | getwalletinfo () |
| |
| static RPCHelpMan | listwalletdir () |
| |
| static RPCHelpMan | listwallets () |
| |
| static RPCHelpMan | loadwallet () |
| |
| static RPCHelpMan | setwalletflag () |
| |
| static RPCHelpMan | createwallet () |
| |
| static RPCHelpMan | unloadwallet () |
| |
| RPCHelpMan | simulaterawtransaction () |
| |
| static RPCHelpMan | migratewallet () |
| |
| RPCHelpMan | gethdkeys () |
| |
| static RPCHelpMan | createwalletdescriptor () |
| |
| std::span< const CRPCCommand > | GetWalletRPCCommands () |
| |
| static bool | ExtractPubKey (const CScript &dest, CPubKey &pubKeyOut) |
| |
| std::vector< CKeyID > | GetAffectedKeys (const CScript &spk, const SigningProvider &provider) |
| |
| static bool | IsSegwit (const Descriptor &desc) |
| | Whether the descriptor represents, directly or not, a witness program.
|
| |
| static bool | UseMaxSig (const std::optional< CTxIn > &txin, const CCoinControl *coin_control) |
| | Whether to assume ECDSA signatures' will be high-r.
|
| |
| static std::optional< int64_t > | MaxInputWeight (const Descriptor &desc, const std::optional< CTxIn > &txin, const CCoinControl *coin_control, const bool tx_is_segwit, const bool can_grind_r) |
| | Get the size of an input (in witness units) once it's signed.
|
| |
| int | CalculateMaximumSignedInputSize (const CTxOut &txout, const COutPoint outpoint, const SigningProvider *provider, bool can_grind_r, const CCoinControl *coin_control) |
| |
| int | CalculateMaximumSignedInputSize (const CTxOut &txout, const CWallet *pwallet, const CCoinControl *coin_control) |
| | Get the marginal bytes if spending the specified output from this transaction.
|
| |
| static std::unique_ptr< Descriptor > | GetDescriptor (const CWallet *wallet, const CCoinControl *coin_control, const CScript script_pubkey) |
| | Infer a descriptor for the given output script.
|
| |
| static std::optional< int64_t > | GetSignedTxinWeight (const CWallet *wallet, const CCoinControl *coin_control, const CTxIn &txin, const CTxOut &txo, const bool tx_is_segwit, const bool can_grind_r) |
| | Infer the maximum size of this input after it will be signed.
|
| |
| TxSize | CalculateMaximumSignedTxSize (const CTransaction &tx, const CWallet *wallet, const std::vector< CTxOut > &txouts, const CCoinControl *coin_control=nullptr) |
| | Calculate the size of the transaction using CoinControl to determine whether to expect signature grinding when calculating the size of the input spend.
|
| |
| TxSize | CalculateMaximumSignedTxSize (const CTransaction &tx, const CWallet *wallet, const CCoinControl *coin_control) |
| |
| static OutputType | GetOutputType (TxoutType type, bool is_from_p2sh) |
| |
| util::Result< CoinsResult > | FetchSelectedInputs (const CWallet &wallet, const CCoinControl &coin_control, const CoinSelectionParams &coin_selection_params) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| | Fetch and validate coin control selected inputs.
|
| |
| CoinsResult | AvailableCoins (const CWallet &wallet, const CCoinControl *coinControl=nullptr, std::optional< CFeeRate > feerate=std::nullopt, const CoinFilterParams ¶ms={}) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| | Populate the CoinsResult struct with vectors of available COutputs, organized by OutputType.
|
| |
| const CTxOut & | FindNonChangeParentOutput (const CWallet &wallet, const COutPoint &outpoint) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| | Find non-change parent output.
|
| |
| std::map< CTxDestination, std::vector< COutput > > | ListCoins (const CWallet &wallet) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| | Return list of available coins and locked coins grouped by non-change output address.
|
| |
| FilteredOutputGroups | GroupOutputs (const CWallet &wallet, const CoinsResult &coins, const CoinSelectionParams &coin_sel_params, const std::vector< SelectionFilter > &filters, std::vector< OutputGroup > &ret_discarded_groups) |
| |
| FilteredOutputGroups | GroupOutputs (const CWallet &wallet, const CoinsResult &coins, const CoinSelectionParams &coin_sel_params, const std::vector< SelectionFilter > &filters) |
| | Group coins by the provided filters.
|
| |
| static bool | HasErrorMsg (const util::Result< SelectionResult > &res) |
| |
| util::Result< SelectionResult > | AttemptSelection (interfaces::Chain &chain, const CAmount &nTargetValue, OutputGroupTypeMap &groups, const CoinSelectionParams &coin_selection_params, bool allow_mixed_output_types) |
| | Attempt to find a valid input set that preserves privacy by not mixing OutputTypes.
|
| |
| util::Result< SelectionResult > | ChooseSelectionResult (interfaces::Chain &chain, const CAmount &nTargetValue, Groups &groups, const CoinSelectionParams &coin_selection_params) |
| | Attempt to find a valid input set that meets the provided eligibility filter and target.
|
| |
| util::Result< SelectionResult > | SelectCoins (const CWallet &wallet, CoinsResult &available_coins, const CoinsResult &pre_set_inputs, const CAmount &nTargetValue, const CCoinControl &coin_control, const CoinSelectionParams &coin_selection_params) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| | Select all coins from coin_control, and if coin_control 'm_allow_other_inputs=true', call 'AutomaticCoinSelection' to select a set of coins such that nTargetValue - pre_set_inputs.total_amount is met.
|
| |
| util::Result< SelectionResult > | AutomaticCoinSelection (const CWallet &wallet, CoinsResult &available_coins, const CAmount &nTargetValue, const CoinSelectionParams &coin_selection_params) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| | Select a set of coins such that nTargetValue is met; never select unconfirmed coins if they are not ours.
|
| |
| static bool | IsCurrentForAntiFeeSniping (interfaces::Chain &chain, const uint256 &block_hash) |
| |
| void | DiscourageFeeSniping (CMutableTransaction &tx, FastRandomContext &rng_fast, interfaces::Chain &chain, const uint256 &block_hash, int block_height) |
| | Set a height-based locktime for new transactions (uses the height of the current chain tip unless we are not synced with the current chain.
|
| |
| uint64_t | GetSerializeSizeForRecipient (const CRecipient &recipient) |
| |
| bool | IsDust (const CRecipient &recipient, const CFeeRate &dustRelayFee) |
| |
| static util::Result< CreatedTransactionResult > | CreateTransactionInternal (CWallet &wallet, const std::vector< CRecipient > &vecSend, std::optional< unsigned int > change_pos, const CCoinControl &coin_control, bool sign) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| |
| util::Result< CreatedTransactionResult > | CreateTransaction (CWallet &wallet, const std::vector< CRecipient > &vecSend, std::optional< unsigned int > change_pos, const CCoinControl &coin_control, bool sign=true) |
| | Create a new transaction paying the recipients with a set of coins selected by SelectCoins(); Also create the change output, when needed.
|
| |
| util::Result< CreatedTransactionResult > | FundTransaction (CWallet &wallet, const CMutableTransaction &tx, const std::vector< CRecipient > &recipients, std::optional< unsigned int > change_pos, bool lockUnspents, CCoinControl) |
| | Insert additional inputs into the transaction by calling CreateTransaction();.
|
| |
| static std::span< const std::byte > | SpanFromBlob (sqlite3_stmt *stmt, int col) |
| |
| static void | ErrorLogCallback (void *arg, int code, const char *msg) |
| |
| static int | TraceSqlCallback (unsigned code, void *context, void *param1, void *param2) |
| |
| static bool | BindBlobToStatement (sqlite3_stmt *stmt, int index, std::span< const std::byte > blob, const std::string &description) |
| |
| static std::optional< int > | ReadPragmaInteger (sqlite3 *db, const std::string &key, const std::string &description, bilingual_str &error) |
| |
| static void | SetPragma (sqlite3 *db, const std::string &key, const std::string &value, const std::string &err_msg) |
| |
| std::unique_ptr< SQLiteDatabase > | MakeSQLiteDatabase (const fs::path &path, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error) |
| |
| std::string | SQLiteDatabaseVersion () |
| |
| static CoinSelectionParams | init_default_params () |
| | Default coin selection parameters (dcsp) allow us to only explicitly set parameters when a diverging value is relevant in the context of a test.
|
| |
| static OutputGroup | MakeCoin (const CAmount &amount, bool is_eff_value=true, CoinSelectionParams cs_params=default_cs_params, int custom_spending_vsize=P2WPKH_INPUT_VSIZE) |
| | Make one OutputGroup with a single UTXO that either has a given effective value (default) or a given amount (is_eff_value = false).
|
| |
| static void | AddCoins (std::vector< OutputGroup > &utxo_pool, std::vector< CAmount > coins, CoinSelectionParams cs_params=default_cs_params) |
| | Make multiple OutputGroups with the given values as their effective value.
|
| |
| static void | AddDuplicateCoins (std::vector< OutputGroup > &utxo_pool, int count, int amount, CoinSelectionParams cs_params=default_cs_params) |
| | Make multiple coins that share the same effective value.
|
| |
| static bool | HaveEquivalentValues (const SelectionResult &a, const SelectionResult &b) |
| | Check if SelectionResult a is equivalent to SelectionResult b.
|
| |
| static std::string | InputAmountsToString (const SelectionResult &selection) |
| |
| static void | TestBnBSuccess (std::string test_title, std::vector< OutputGroup > &utxo_pool, const CAmount &selection_target, const std::vector< CAmount > &expected_input_amounts, const CoinSelectionParams &cs_params=default_cs_params, const int custom_spending_vsize=P2WPKH_INPUT_VSIZE, const int max_selection_weight=MAX_STANDARD_TX_WEIGHT) |
| |
| static void | TestBnBFail (std::string test_title, std::vector< OutputGroup > &utxo_pool, const CAmount &selection_target, int max_selection_weight=MAX_STANDARD_TX_WEIGHT, const bool expect_max_weight_exceeded=false) |
| |
| | BOOST_AUTO_TEST_CASE (bnb_test) |
| |
| | BOOST_AUTO_TEST_CASE (bnb_feerate_sensitivity_test) |
| |
| static void | add_coin (const CAmount &nValue, int nInput, SelectionResult &result) |
| |
| static void | add_coin (const CAmount &nValue, int nInput, SelectionResult &result, CAmount fee, CAmount long_term_fee) |
| |
| static void | add_coin (CoinsResult &available_coins, CWallet &wallet, const CAmount &nValue, CFeeRate feerate=CFeeRate(0), int nAge=6 *24, bool fIsFromMe=false, int nInput=0, bool spendable=false, int custom_size=0) |
| |
| std::optional< SelectionResult > | KnapsackSolver (std::vector< OutputGroup > &groups, const CAmount &nTargetValue, CAmount change_target, FastRandomContext &rng) |
| |
| std::optional< SelectionResult > | SelectCoinsBnB (std::vector< OutputGroup > &utxo_pool, const CAmount &selection_target, const CAmount &cost_of_change) |
| |
| static bool | EquivalentResult (const SelectionResult &a, const SelectionResult &b) |
| | Check if SelectionResult a is equivalent to SelectionResult b.
|
| |
| static bool | EqualResult (const SelectionResult &a, const SelectionResult &b) |
| | Check if this selection is equal to another one.
|
| |
| std::vector< OutputGroup > & | GroupCoins (const std::vector< COutput > &available_coins, bool subtract_fee_outputs=false) |
| |
| std::vector< OutputGroup > & | KnapsackGroupOutputs (const CoinsResult &available_coins, CWallet &wallet, const CoinEligibilityFilter &filter) |
| |
| static std::unique_ptr< CWallet > | NewWallet (const node::NodeContext &m_node, const std::string &wallet_name="") |
| |
| | BOOST_AUTO_TEST_CASE (bnb_search_test) |
| |
| | BOOST_AUTO_TEST_CASE (bnb_sffo_restriction) |
| |
| | BOOST_AUTO_TEST_CASE (knapsack_solver_test) |
| |
| | BOOST_AUTO_TEST_CASE (ApproximateBestSubset) |
| |
| | BOOST_AUTO_TEST_CASE (SelectCoins_test) |
| |
| | BOOST_AUTO_TEST_CASE (waste_test) |
| |
| | BOOST_AUTO_TEST_CASE (bump_fee_test) |
| |
| | BOOST_AUTO_TEST_CASE (effective_value_test) |
| |
| static util::Result< SelectionResult > | CoinGrinder (const CAmount &target, const CoinSelectionParams &cs_params, const node::NodeContext &m_node, int max_selection_weight, std::function< CoinsResult(CWallet &)> coin_setup) |
| |
| | BOOST_AUTO_TEST_CASE (coin_grinder_tests) |
| |
| static util::Result< SelectionResult > | SelectCoinsSRD (const CAmount &target, const CoinSelectionParams &cs_params, const node::NodeContext &m_node, int max_selection_weight, std::function< CoinsResult(CWallet &)> coin_setup) |
| |
| | BOOST_AUTO_TEST_CASE (srd_tests) |
| |
| static util::Result< SelectionResult > | select_coins (const CAmount &target, const CoinSelectionParams &cs_params, const CCoinControl &cc, std::function< CoinsResult(CWallet &)> coin_setup, const node::NodeContext &m_node) |
| |
| static bool | has_coin (const OutputSet &set, CAmount amount) |
| |
| | BOOST_AUTO_TEST_CASE (check_max_selection_weight) |
| |
| | BOOST_AUTO_TEST_CASE (SelectCoins_effective_value_test) |
| |
| | BOOST_FIXTURE_TEST_CASE (wallet_coinsresult_test, BasicTestingSetup) |
| |
| std::span< const std::byte > | StringBytes (std::string_view str) |
| |
| static SerializeData | StringData (std::string_view str) |
| |
| static void | CheckPrefix (DatabaseBatch &batch, std::span< const std::byte > prefix, MockableData expected) |
| |
| static std::vector< std::unique_ptr< WalletDatabase > > | TestDatabases (const fs::path &path_root) |
| |
| | BOOST_AUTO_TEST_CASE (db_cursor_prefix_range_test) |
| |
| | BOOST_AUTO_TEST_CASE (db_cursor_prefix_byte_test) |
| |
| | BOOST_AUTO_TEST_CASE (db_availability_after_write_error) |
| |
| | BOOST_AUTO_TEST_CASE (erase_prefix) |
| |
| | BOOST_AUTO_TEST_CASE (txn_close_failure_dangling_txn) |
| |
| | BOOST_AUTO_TEST_CASE (concurrent_txn_dont_interfere) |
| |
| static void | AddCoin (const CAmount &value, int n_input, int n_input_bytes, int locktime, std::vector< COutput > &coins, CFeeRate fee_rate) |
| |
| static void | GroupCoins (FuzzedDataProvider &fuzzed_data_provider, const std::vector< COutput > &coins, const CoinSelectionParams &coin_params, bool positive_only, std::vector< OutputGroup > &output_groups) |
| |
| static CAmount | CreateCoins (FuzzedDataProvider &fuzzed_data_provider, std::vector< COutput > &utxo_pool, CoinSelectionParams &coin_params, int &next_locktime) |
| |
| static SelectionResult | ManualSelection (std::vector< COutput > &utxos, const CAmount &total_amount, const bool &subtract_fee_outputs) |
| |
| static bool | HasErrorMsg (const util::Result< SelectionResult > &res) |
| |
| | FUZZ_TARGET (coin_grinder) |
| |
| | FUZZ_TARGET (coin_grinder_is_optimal) |
| |
| | FUZZ_TARGET (bnb_finds_min_waste) |
| |
| template<CoinSelectionAlgorithm Algorithm> |
| void | FuzzCoinSelectionAlgorithm (std::span< const uint8_t > buffer) |
| |
| | FUZZ_TARGET (coinselection_bnb) |
| |
| | FUZZ_TARGET (coinselection_srd) |
| |
| | FUZZ_TARGET (coinselection_knapsack) |
| |
| static std::shared_ptr< CWallet > | NewWallet (const node::NodeContext &m_node) |
| |
| static void | addCoin (CoinsResult &coins, CWallet &wallet, const CTxDestination &dest, const CAmount &nValue, bool is_from_me, CFeeRate fee_rate=CFeeRate(0), int depth=6) |
| |
| CoinSelectionParams | makeSelectionParams (FastRandomContext &rand, bool avoid_partial_spends) |
| |
| | BOOST_AUTO_TEST_CASE (outputs_grouping_tests) |
| |
| | BOOST_AUTO_TEST_CASE (walletinit_verify_walletdir_default) |
| |
| | BOOST_AUTO_TEST_CASE (walletinit_verify_walletdir_custom) |
| |
| | BOOST_AUTO_TEST_CASE (walletinit_verify_walletdir_does_not_exist) |
| |
| | BOOST_AUTO_TEST_CASE (walletinit_verify_walletdir_is_not_directory) |
| |
| | BOOST_AUTO_TEST_CASE (walletinit_verify_walletdir_is_not_relative) |
| |
| | BOOST_AUTO_TEST_CASE (walletinit_verify_walletdir_no_trailing) |
| |
| | BOOST_AUTO_TEST_CASE (walletinit_verify_walletdir_no_trailing2) |
| |
| | BOOST_AUTO_TEST_CASE (ismine_standard) |
| |
| static void | import_descriptor (CWallet &wallet, const std::string &descriptor) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| |
| | BOOST_AUTO_TEST_CASE (psbt_updater_test) |
| |
| | BOOST_AUTO_TEST_CASE (parse_hd_keypath) |
| |
| | BOOST_AUTO_TEST_CASE (DescriptorScriptPubKeyManTests) |
| |
| | BOOST_FIXTURE_TEST_CASE (SubtractFee, TestChain100Setup) |
| |
| | BOOST_FIXTURE_TEST_CASE (wallet_duplicated_preset_inputs_test, TestChain100Setup) |
| |
| std::unique_ptr< CWallet > | CreateSyncedWallet (interfaces::Chain &chain, CChain &cchain, const CKey &key) |
| |
| std::shared_ptr< CWallet > | TestCreateWallet (std::unique_ptr< WalletDatabase > database, WalletContext &context, uint64_t create_flags) |
| |
| std::shared_ptr< CWallet > | TestCreateWallet (WalletContext &context) |
| |
| std::shared_ptr< CWallet > | TestLoadWallet (std::unique_ptr< WalletDatabase > database, WalletContext &context) |
| |
| std::shared_ptr< CWallet > | TestLoadWallet (WalletContext &context) |
| |
| void | TestUnloadWallet (std::shared_ptr< CWallet > &&wallet) |
| |
| std::unique_ptr< WalletDatabase > | DuplicateMockDatabase (WalletDatabase &database) |
| |
| std::string | getnewaddress (CWallet &w) |
| | Returns a new encoded destination from the wallet (hardcoded to BECH32)
|
| |
| CTxDestination | getNewDestination (CWallet &w, OutputType output_type) |
| | Returns a new destination, of an specific type, from the wallet.
|
| |
| std::unique_ptr< WalletDatabase > | CreateMockableWalletDatabase (MockableData records) |
| |
| MockableDatabase & | GetMockableDatabase (CWallet &wallet) |
| |
| wallet::DescriptorScriptPubKeyMan * | CreateDescriptor (CWallet &keystore, const std::string &desc_str, const bool success) |
| |
| | BOOST_AUTO_TEST_CASE (passphrase) |
| |
| | BOOST_AUTO_TEST_CASE (encrypt) |
| |
| | BOOST_AUTO_TEST_CASE (decrypt) |
| |
| static std::string | TestWalletName (const std::string &endpoint, std::optional< std::string > parameter=std::nullopt) |
| |
| | BOOST_AUTO_TEST_CASE (ensure_unique_wallet_name) |
| |
| static CMutableTransaction | TestSimpleSpend (const CTransaction &from, uint32_t index, const CKey &key, const CScript &pubkey) |
| |
| static void | AddKey (CWallet &wallet, const CKey &key) |
| |
| | BOOST_FIXTURE_TEST_CASE (update_non_range_descriptor, TestingSetup) |
| |
| | BOOST_FIXTURE_TEST_CASE (scan_for_wallet_transactions, TestChain100Setup) |
| |
| | BOOST_FIXTURE_TEST_CASE (write_wallet_settings_concurrently, TestingSetup) |
| |
| static int64_t | AddTx (ChainstateManager &chainman, CWallet &wallet, uint32_t lockTime, int64_t mockTime, int64_t blockTime) |
| |
| | BOOST_AUTO_TEST_CASE (ComputeTimeSmart) |
| |
| void | TestLoadWallet (const std::string &name, DatabaseFormat format, std::function< void(std::shared_ptr< CWallet >)> f) |
| |
| | BOOST_FIXTURE_TEST_CASE (LoadReceiveRequests, TestingSetup) |
| |
| | BOOST_FIXTURE_TEST_CASE (ListCoinsTest, ListCoinsTestingSetup) |
| |
| void | TestCoinsResult (ListCoinsTest &context, OutputType out_type, CAmount amount, std::map< OutputType, size_t > &expected_coins_sizes) |
| |
| | BOOST_FIXTURE_TEST_CASE (BasicOutputTypesTest, ListCoinsTest) |
| |
| | BOOST_FIXTURE_TEST_CASE (wallet_disableprivkeys, TestChain100Setup) |
| |
| static size_t | CalculateNestedKeyhashInputSize (bool use_max_sig) |
| |
| | BOOST_FIXTURE_TEST_CASE (dummy_input_size_test, TestChain100Setup) |
| |
| bool | malformed_descriptor (std::ios_base::failure e) |
| |
| | BOOST_FIXTURE_TEST_CASE (wallet_descriptor_test, BasicTestingSetup) |
| |
| | BOOST_FIXTURE_TEST_CASE (CreateWallet, TestChain100Setup) |
| | Test CWallet::CreateNew() and its behavior handling potential race conditions if it's called the same time an incoming transaction shows up in the mempool or a new block.
|
| |
| | BOOST_FIXTURE_TEST_CASE (CreateWalletWithoutChain, BasicTestingSetup) |
| |
| | BOOST_FIXTURE_TEST_CASE (RemoveTxs, TestChain100Setup) |
| |
| | BOOST_AUTO_TEST_CASE (roundtrip) |
| |
| | BOOST_AUTO_TEST_CASE (walletdb_readkeyvalue) |
| |
| | BOOST_FIXTURE_TEST_CASE (wallet_load_descriptors, TestingSetup) |
| |
| static TxState | TxStateInterpretSerialized (TxStateUnrecognized data) |
| | Try to interpret deserialized TxStateUnrecognized data as a recognized state.
|
| |
| static uint256 | TxStateSerializedBlockHash (const TxState &state) |
| | Get TxState serialized block hash. Inverse of TxStateInterpretSerialized.
|
| |
| static int | TxStateSerializedIndex (const TxState &state) |
| | Get TxState serialized block index. Inverse of TxStateInterpretSerialized.
|
| |
| template<typename T > |
| std::string | TxStateString (const T &state) |
| | Return TxState or SyncTxState as a string for logging or debugging.
|
| |
| bool | AddWalletSetting (interfaces::Chain &chain, const std::string &wallet_name) |
| | Add wallet name to persistent configuration so it will be loaded on startup.
|
| |
| bool | RemoveWalletSetting (interfaces::Chain &chain, const std::string &wallet_name) |
| | Remove wallet name from persistent configuration so it will not be loaded on startup.
|
| |
| static void | UpdateWalletSetting (interfaces::Chain &chain, const std::string &wallet_name, std::optional< bool > load_on_startup, std::vector< bilingual_str > &warnings) |
| |
| static void | RefreshMempoolStatus (CWalletTx &tx, interfaces::Chain &chain) |
| | Refresh mempool status so the wallet is in an internally consistent state and immediately knows the transaction's status: Whether it can be considered trusted and is eligible to be abandoned ...
|
| |
| bool | AddWallet (WalletContext &context, const std::shared_ptr< CWallet > &wallet) |
| |
| bool | RemoveWallet (WalletContext &context, const std::shared_ptr< CWallet > &wallet, std::optional< bool > load_on_start, std::vector< bilingual_str > &warnings) |
| |
| bool | RemoveWallet (WalletContext &context, const std::shared_ptr< CWallet > &wallet, std::optional< bool > load_on_start) |
| |
| std::vector< std::shared_ptr< CWallet > > | GetWallets (WalletContext &context) |
| |
| std::shared_ptr< CWallet > | GetDefaultWallet (WalletContext &context, size_t &count) |
| |
| std::shared_ptr< CWallet > | GetWallet (WalletContext &context, const std::string &name) |
| |
| std::unique_ptr< interfaces::Handler > | HandleLoadWallet (WalletContext &context, LoadWalletFn load_wallet) |
| |
| void | NotifyWalletLoaded (WalletContext &context, const std::shared_ptr< CWallet > &wallet) |
| |
| static std::set< std::string > g_loading_wallet_set | GUARDED_BY (g_loading_wallet_mutex) |
| |
| static std::set< std::string > g_unloading_wallet_set | GUARDED_BY (g_wallet_release_mutex) |
| |
| static void | FlushAndDeleteWallet (CWallet *wallet) |
| |
| void | WaitForDeleteWallet (std::shared_ptr< CWallet > &&wallet) |
| | Explicitly delete the wallet.
|
| |
| std::shared_ptr< CWallet > | LoadWallet (WalletContext &context, const std::string &name, std::optional< bool > load_on_start, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings) |
| |
| std::shared_ptr< CWallet > | CreateWallet (WalletContext &context, const std::string &name, std::optional< bool > load_on_start, DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings) |
| |
| std::shared_ptr< CWallet > | RestoreWallet (WalletContext &context, const fs::path &backup_file, const std::string &wallet_name, std::optional< bool > load_on_start, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings, bool load_after_restore, bool allow_unnamed) |
| |
| static bool | EncryptMasterKey (const SecureString &wallet_passphrase, const CKeyingMaterial &plain_master_key, CMasterKey &master_key) |
| |
| static bool | DecryptMasterKey (const SecureString &wallet_passphrase, const CMasterKey &master_key, CKeyingMaterial &plain_master_key) |
| |
| void | MaybeResendWalletTxs (WalletContext &context) |
| | Called periodically by the schedule thread.
|
| |
| static util::Result< fs::path > | GetWalletPath (const std::string &name) |
| |
| std::unique_ptr< WalletDatabase > | MakeWalletDatabase (const std::string &name, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error_string) |
| |
| static std::string | MigrationPrefixName (CWallet &wallet) |
| |
| bool | DoMigration (CWallet &wallet, WalletContext &context, bilingual_str &error, MigrationResult &res) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet) |
| |
| util::Result< MigrationResult > | MigrateLegacyToDescriptor (const std::string &wallet_name, const SecureString &passphrase, WalletContext &context) |
| | Do all steps to migrate a legacy wallet to a descriptor wallet.
|
| |
| util::Result< MigrationResult > | MigrateLegacyToDescriptor (std::shared_ptr< CWallet > local_wallet, const SecureString &passphrase, WalletContext &context) |
| | Requirement: The wallet provided to this function must be isolated, with no attachment to the node's context.
|
| |
| std::string | PurposeToString (AddressPurpose p) |
| |
| std::optional< AddressPurpose > | PurposeFromString (std::string_view s) |
| |
| void | LogDBInfo () |
| |
| bool | LoadKey (CWallet *pwallet, DataStream &ssKey, DataStream &ssValue, std::string &strErr) |
| |
| bool | LoadCryptedKey (CWallet *pwallet, DataStream &ssKey, DataStream &ssValue, std::string &strErr) |
| |
| bool | LoadEncryptionKey (CWallet *pwallet, DataStream &ssKey, DataStream &ssValue, std::string &strErr) |
| |
| bool | LoadHDChain (CWallet *pwallet, DataStream &ssValue, std::string &strErr) |
| |
| static DBErrors | LoadWalletFlags (CWallet *pwallet, DatabaseBatch &batch) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet) |
| |
| static LoadResult | LoadRecords (CWallet *pwallet, DatabaseBatch &batch, const std::string &key, DataStream &prefix, LoadFunc load_func) |
| |
| static LoadResult | LoadRecords (CWallet *pwallet, DatabaseBatch &batch, const std::string &key, LoadFunc load_func) |
| |
| bool | HasLegacyRecords (CWallet &wallet) |
| | Returns true if there are any DBKeys::LEGACY_TYPES record in the wallet db.
|
| |
| bool | HasLegacyRecords (CWallet &wallet, DatabaseBatch &batch) |
| |
| static DBErrors | LoadLegacyWalletRecords (CWallet *pwallet, DatabaseBatch &batch, int last_client) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet) |
| |
| template<typename... Args> |
| static DataStream | PrefixStream (const Args &... args) |
| |
| static DBErrors | LoadDescriptorWalletRecords (CWallet *pwallet, DatabaseBatch &batch, int last_client) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet) |
| |
| static DBErrors | LoadAddressBookRecords (CWallet *pwallet, DatabaseBatch &batch) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet) |
| |
| static DBErrors | LoadTxRecords (CWallet *pwallet, DatabaseBatch &batch, bool &any_unordered) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet) |
| |
| static DBErrors | LoadActiveSPKMs (CWallet *pwallet, DatabaseBatch &batch) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet) |
| |
| static DBErrors | LoadDecryptionKeys (CWallet *pwallet, DatabaseBatch &batch) EXCLUSIVE_LOCKS_REQUIRED(pwallet -> cs_wallet) |
| |
| static bool | RunWithinTxn (WalletBatch &batch, std::string_view process_desc, const std::function< bool(WalletBatch &)> &func) |
| |
| bool | RunWithinTxn (WalletDatabase &database, std::string_view process_desc, const std::function< bool(WalletBatch &)> &func) |
| | Executes the provided function 'func' within a database transaction context.
|
| |
| fs::path | GetWalletDir () |
| | Get the path of the wallet directory.
|
| |
| WalletDescriptor | GenerateWalletDescriptor (const CExtPubKey &master_key, const OutputType &addr_type, bool internal) |
| |