![]() |
Bitcoin Core 31.0.0
P2P Digital Currency
|
Definition at line 1290 of file wallet.cpp.
Definition at line 787 of file wallet.cpp.
| CWalletTx * wallet::CWallet::AddToWallet | ( | CTransactionRef | tx, |
| const TxState & | state, | ||
| const UpdateWalletTxFn & | update_wtx = nullptr, | ||
| bool | rescanning_old_block = false ) |
Add the transaction to the wallet, wrapping it up inside a CWalletTx.
Definition at line 1025 of file wallet.cpp.
|
private |
Add a transaction to the wallet, or update it.
confirm.block_* should be set when the transaction was known to be included in a block. When block_hash.IsNull(), then wallet state is not updated in AddToWallet, but notifications happen and cached balances are marked dirty.
If fUpdate is true, existing transactions will be updated. TODO: One exception to this is that the abandoned state is cleared under the assumption that any further notification of a transaction that was considered abandoned is an indication that it is not safe to be considered abandoned. Abandoned state should probably be more carefully tracked via different chain notifications or by checking mempool presence when necessary.
Should be called with rescanning_old_block set to true, if the transaction is not discovered in real time, but during a rescan of old blocks.
Definition at line 1190 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1526 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1555 of file wallet.cpp.
| bool wallet::CWallet::ChangeWalletPassphrase | ( | const SecureString & | strOldWalletPassphrase, |
| const SecureString & | strNewWalletPassphrase ) |
| void wallet::CWallet::Close | ( | ) |
Close wallet database.
Definition at line 724 of file wallet.cpp.
|
static |
Definition at line 607 of file wallet.cpp.
|
static |
Definition at line 580 of file wallet.cpp.
| bool wallet::CWallet::EncryptWallet | ( | const SecureString & | strWalletPassphrase | ) |
Get wallet transactions that conflict with given transaction (spend same outputs)
Definition at line 689 of file wallet.cpp.
| CAmount wallet::CWallet::GetDebit | ( | const CTransaction & | tx | ) | const |
Returns amount of debit, i.e.
the amount leaving this wallet due to this input
Definition at line 1619 of file wallet.cpp.
|
staticprivate |
Definition at line 2078 of file wallet.cpp.
| uint64_t wallet::CWallet::GetWalletFlags | ( | ) | const |
Retrieve all of the wallet's flags.
Definition at line 1792 of file wallet.cpp.
| bool wallet::CWallet::HasWalletSpend | ( | const CTransactionRef & | tx | ) | const |
Check if a given transaction has any of its outputs spent by another transaction in the wallet.
Definition at line 712 of file wallet.cpp.
| int64_t wallet::CWallet::IncOrderPosNext | ( | WalletBatch * | batch = nullptr | ) |
Increment the next transaction order id.
Definition at line 940 of file wallet.cpp.
overwrite all flags by the given uint64_t flags must be uninitialised (or 0) only known flags may be present
Definition at line 1776 of file wallet.cpp.
| bool wallet::CWallet::IsFromMe | ( | const CTransaction & | tx | ) | const |
should probably be renamed to IsRelevantToMe
Definition at line 1681 of file wallet.cpp.
| bool wallet::CWallet::IsHDEnabled | ( | ) | const |
| bool wallet::CWallet::IsMine | ( | const CTransaction & | tx | ) | const |
| bool wallet::CWallet::IsMine | ( | const CTxDestination & | dest | ) | const |
Definition at line 1635 of file wallet.cpp.
Outpoint is spent if any non-conflicted transaction spends it:
Definition at line 770 of file wallet.cpp.
check if a certain wallet flag is set
Implements wallet::WalletStorage.
Definition at line 1759 of file wallet.cpp.
| bool wallet::CWallet::LoadToWallet | ( | const Txid & | hash, |
| const UpdateWalletTxFn & | fill_wtx ) |
Definition at line 1156 of file wallet.cpp.
Loads the flags into the wallet.
(used by LoadWallet)
Definition at line 1764 of file wallet.cpp.
|
private |
Mark a transaction (and its in-wallet descendants) as conflicting with a particular block.
Definition at line 1328 of file wallet.cpp.
| void wallet::CWallet::MarkDirty | ( | ) |
Definition at line 952 of file wallet.cpp.
|
private |
Mark a transaction's inputs dirty, thus forcing the outputs to be recomputed.
Definition at line 1280 of file wallet.cpp.
Mark a transaction as replaced by another transaction.
Definition at line 961 of file wallet.cpp.
Updates wallet birth time if 'time' is below it.
Definition at line 1797 of file wallet.cpp.
|
private |
Mark a transaction (and its in-wallet descendants) as a particular tx state.
Definition at line 1358 of file wallet.cpp.
|
private |
| DBErrors wallet::CWallet::ReorderTransactions | ( | ) |
Definition at line 883 of file wallet.cpp.
| int64_t wallet::CWallet::RescanFromTime | ( | int64_t | startTime, |
| const WalletRescanReserver & | reserver, | ||
| bool | update ) |
Scan active chain for relevant transactions after importing keys.
This should be called whenever new keys are added to the wallet, with the oldest key creation time.
Definition at line 1813 of file wallet.cpp.
| void wallet::CWallet::ResubmitWalletTransactions | ( | node::TxBroadcast | broadcast_method, |
| bool | force ) |
Definition at line 2105 of file wallet.cpp.
| CWallet::ScanResult wallet::CWallet::ScanForWalletTransactions | ( | const uint256 & | start_block, |
| int | start_height, | ||
| std::optional< int > | max_height, | ||
| const WalletRescanReserver & | reserver, | ||
| bool | fUpdate, | ||
| bool | save_progress ) |
Scan the block chain (starting in start_block) for transactions from or to us.
If fUpdate is true, found transactions that already exist in the wallet will be updated. If max_height is not set, the mempool will be scanned as well.
| [in] | start_block | Scan starting block. If block is not on the active chain, the scan will return SUCCESS immediately. |
| [in] | start_height | Height of start_block |
| [in] | max_height | Optional max scanning height. If unset there is no maximum and scanning can continue to the tip |
Definition at line 1857 of file wallet.cpp.
Set last block processed height, and write to database.
Definition at line 681 of file wallet.cpp.
Definition at line 673 of file wallet.cpp.
| void wallet::CWallet::SetSpentKeyState | ( | WalletBatch & | batch, |
| const Txid & | hash, | ||
| unsigned int | n, | ||
| bool | used, | ||
| std::set< CTxDestination > & | tx_destinations ) |
Definition at line 993 of file wallet.cpp.
Blocks until the wallet state is up-to-date to /at least/ the current chain at the time this function is entered Obviously holding cs_main/cs_wallet when going into this call may cause deadlock.
set a single wallet flag
Definition at line 1726 of file wallet.cpp.
|
private |
Store wallet flags.
Definition at line 1732 of file wallet.cpp.
| bool wallet::CWallet::ShouldResend | ( | ) | const |
Return true if all conditions for periodically resending transactions are met.
Definition at line 2061 of file wallet.cpp.
| bool wallet::CWallet::SubmitTxMemoryPoolAndRelay | ( | CWalletTx & | wtx, |
| std::string & | err_string, | ||
| node::TxBroadcast | broadcast_method ) const |
Pass this transaction to node for optional mempool insertion and relay to peers.
Definition at line 2008 of file wallet.cpp.
|
private |
Definition at line 729 of file wallet.cpp.
|
private |
Definition at line 1402 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1414 of file wallet.cpp.
Return whether transaction can be abandoned.
Definition at line 1256 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1457 of file wallet.cpp.
| bool wallet::CWallet::Unlock | ( | const SecureString & | strWalletPassphrase | ) |
|
overrideprivatevirtual |
Unset the blank wallet flag and saves it to disk.
Implements wallet::WalletStorage.
Definition at line 1754 of file wallet.cpp.
Unsets a single wallet flag.
Definition at line 1740 of file wallet.cpp.
|
private |
Unsets a wallet flag and saves it to disk.
Definition at line 1746 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1602 of file wallet.cpp.
|
private |
Update mempool conflicts for TRUC sibling transactions.
Definition at line 1263 of file wallet.cpp.
| void wallet::CWallet::UpgradeDescriptorCache | ( | ) |
Upgrade DescriptorCaches.
Definition at line 565 of file wallet.cpp.