![]() |
Bitcoin Core 29.99.0
P2P Digital Currency
|
Functions | |
static bool | wallet::EncryptMasterKey (const SecureString &wallet_passphrase, const CKeyingMaterial &plain_master_key, CMasterKey &master_key) |
static bool | wallet::DecryptMasterKey (const SecureString &wallet_passphrase, const CMasterKey &master_key, CKeyingMaterial &plain_master_key) |
const CWalletTx * | wallet::CWallet::GetWalletTx (const Txid &hash) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
void | wallet::CWallet::UpgradeDescriptorCache () EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Upgrade DescriptorCaches. More... | |
bool | wallet::CWallet::Unlock (const SecureString &strWalletPassphrase) |
bool | wallet::CWallet::ChangeWalletPassphrase (const SecureString &strOldWalletPassphrase, const SecureString &strNewWalletPassphrase) |
void | wallet::CWallet::SetLastBlockProcessedInMem (int block_height, uint256 block_hash) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
void | wallet::CWallet::SetLastBlockProcessed (int block_height, uint256 block_hash) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Set last block processed height, and write to database. More... | |
void | wallet::CWallet::SetMinVersion (enum WalletFeature, WalletBatch *batch_in=nullptr) override |
signify that a particular wallet feature is now used. More... | |
std::set< Txid > | wallet::CWallet::GetConflicts (const Txid &txid) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Get wallet transactions that conflict with given transaction (spend same outputs) More... | |
bool | wallet::CWallet::HasWalletSpend (const CTransactionRef &tx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Check if a given transaction has any of its outputs spent by another transaction in the wallet. More... | |
void | wallet::CWallet::Close () |
Close wallet database. More... | |
void | wallet::CWallet::SyncMetaData (std::pair< TxSpends::iterator, TxSpends::iterator >) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | wallet::CWallet::IsSpent (const COutPoint &outpoint) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Outpoint is spent if any non-conflicted transaction spends it: More... | |
void | wallet::CWallet::AddToSpends (const COutPoint &outpoint, const Txid &txid, WalletBatch *batch=nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
void | wallet::CWallet::AddToSpends (const CWalletTx &wtx, WalletBatch *batch=nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | wallet::CWallet::EncryptWallet (const SecureString &strWalletPassphrase) |
DBErrors | wallet::CWallet::ReorderTransactions () |
int64_t | wallet::CWallet::IncOrderPosNext (WalletBatch *batch=nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Increment the next transaction order id. More... | |
void | wallet::CWallet::MarkDirty () |
bool | wallet::CWallet::MarkReplaced (const Txid &originalHash, const Txid &newHash) |
Mark a transaction as replaced by another transaction. More... | |
void | wallet::CWallet::SetSpentKeyState (WalletBatch &batch, const Txid &hash, unsigned int n, bool used, std::set< CTxDestination > &tx_destinations) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | wallet::CWallet::IsSpentKey (const CScript &scriptPubKey) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
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. More... | |
bool | wallet::CWallet::LoadToWallet (const Txid &hash, const UpdateWalletTxFn &fill_wtx) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | wallet::CWallet::AddToWalletIfInvolvingMe (const CTransactionRef &tx, const SyncTxState &state, bool fUpdate, bool rescanning_old_block) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Add a transaction to the wallet, or update it. More... | |
bool | wallet::CWallet::TransactionCanBeAbandoned (const Txid &hashTx) const |
Return whether transaction can be abandoned. More... | |
void | wallet::CWallet::MarkInputsDirty (const CTransactionRef &tx) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Mark a transaction's inputs dirty, thus forcing the outputs to be recomputed. More... | |
bool | wallet::CWallet::AbandonTransaction (const Txid &hashTx) |
bool | wallet::CWallet::AbandonTransaction (CWalletTx &tx) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
void | wallet::CWallet::MarkConflicted (const uint256 &hashBlock, int conflicting_height, const Txid &hashTx) |
Mark a transaction (and its in-wallet descendants) as conflicting with a particular block. More... | |
void | wallet::CWallet::RecursiveUpdateTxState (const Txid &tx_hash, const TryUpdatingStateFn &try_updating_state) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Mark a transaction (and its in-wallet descendants) as a particular tx state. More... | |
void | wallet::CWallet::RecursiveUpdateTxState (WalletBatch *batch, const Txid &tx_hash, const TryUpdatingStateFn &try_updating_state) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | wallet::CWallet::SyncTransaction (const CTransactionRef &tx, const SyncTxState &state, bool update_tx=true, bool rescanning_old_block=false) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
void | wallet::CWallet::transactionAddedToMempool (const CTransactionRef &tx) override |
void | wallet::CWallet::transactionRemovedFromMempool (const CTransactionRef &tx, MemPoolRemovalReason reason) override |
void | wallet::CWallet::blockConnected (ChainstateRole role, const interfaces::BlockInfo &block) override |
void | wallet::CWallet::blockDisconnected (const interfaces::BlockInfo &block) override |
void | wallet::CWallet::updatedBlockTip () override |
CAmount | wallet::CWallet::GetDebit (const CTxIn &txin, const isminefilter &filter) const |
Returns amount of debit if the input matches the filter, otherwise returns 0. More... | |
isminetype | wallet::CWallet::IsMine (const CTxOut &txout) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
isminetype | wallet::CWallet::IsMine (const CTxDestination &dest) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
isminetype | wallet::CWallet::IsMine (const CScript &script) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | wallet::CWallet::IsMine (const CTransaction &tx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
isminetype | wallet::CWallet::IsMine (const COutPoint &outpoint) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | wallet::CWallet::IsFromMe (const CTransaction &tx) const |
should probably be renamed to IsRelevantToMe More... | |
CAmount | wallet::CWallet::GetDebit (const CTransaction &tx, const isminefilter &filter) const |
bool | wallet::CWallet::IsHDEnabled () const |
bool | wallet::CWallet::CanGetAddresses (bool internal=false) const |
void BlockUntilSyncedToCurrentChain() const LOCKS_EXCLUDED(void | wallet::CWallet::SetWalletFlag (uint64_t flags) |
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. More... | |
void | wallet::CWallet::SetWalletFlagWithDB (WalletBatch &batch, uint64_t flags) |
Store wallet flags. More... | |
void | wallet::CWallet::UnsetWalletFlag (uint64_t flag) |
Unsets a single wallet flag. More... | |
void | wallet::CWallet::UnsetWalletFlagWithDB (WalletBatch &batch, uint64_t flag) |
Unsets a wallet flag and saves it to disk. More... | |
void | wallet::CWallet::UnsetBlankWalletFlag (WalletBatch &batch) override |
Unset the blank wallet flag and saves it to disk. More... | |
bool | wallet::CWallet::IsWalletFlagSet (uint64_t flag) const override |
check if a certain wallet flag is set More... | |
bool | wallet::CWallet::LoadWalletFlags (uint64_t flags) |
Loads the flags into the wallet. More... | |
void | wallet::CWallet::InitWalletFlags (uint64_t flags) |
overwrite all flags by the given uint64_t flags must be uninitialised (or 0) only known flags may be present More... | |
void | wallet::CWallet::MaybeUpdateBirthTime (int64_t time) |
Updates wallet birth time if 'time' is below it. More... | |
int64_t | wallet::CWallet::RescanFromTime (int64_t startTime, const WalletRescanReserver &reserver, bool update) |
Scan active chain for relevant transactions after importing keys. More... | |
ScanResult | wallet::CWallet::ScanForWalletTransactions (const uint256 &start_block, int start_height, std::optional< int > max_height, const WalletRescanReserver &reserver, bool fUpdate, const bool save_progress) |
Scan the block chain (starting in start_block) for transactions from or to us. More... | |
bool | wallet::CWallet::SubmitTxMemoryPoolAndRelay (CWalletTx &wtx, std::string &err_string, bool relay) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Pass this transaction to node for mempool insertion and relay to peers if flag set to true. More... | |
std::set< Txid > | wallet::CWallet::GetTxConflicts (const CWalletTx &wtx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | wallet::CWallet::ShouldResend () const |
Return true if all conditions for periodically resending transactions are met. More... | |
static NodeClock::time_point | wallet::CWallet::GetDefaultNextResend () |
void | wallet::CWallet::ResubmitWalletTransactions (bool relay, bool force) |
bool wallet::CWallet::AbandonTransaction | ( | const Txid & | hashTx | ) |
Definition at line 1274 of file wallet.cpp.
bool wallet::CWallet::AbandonTransaction | ( | CWalletTx & | tx | ) |
|
private |
Definition at line 788 of file wallet.cpp.
|
private |
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 1031 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 1191 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1474 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1503 of file wallet.cpp.
bool wallet::CWallet::CanGetAddresses | ( | bool | internal = false | ) | const |
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 590 of file wallet.cpp.
|
static |
Definition at line 563 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 isminefilter & | filter | ||
) | const |
CAmount wallet::CWallet::GetDebit | ( | const CTxIn & | txin, |
const isminefilter & | filter | ||
) | const |
Returns amount of debit if the input matches the filter, otherwise returns 0.
Definition at line 1567 of file wallet.cpp.
|
staticprivate |
Definition at line 2010 of file wallet.cpp.
Definition at line 539 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 946 of file wallet.cpp.
void wallet::CWallet::InitWalletFlags | ( | uint64_t | flags | ) |
overwrite all flags by the given uint64_t flags must be uninitialised (or 0) only known flags may be present
Definition at line 1726 of file wallet.cpp.
bool wallet::CWallet::IsFromMe | ( | const CTransaction & | tx | ) | const |
should probably be renamed to IsRelevantToMe
Definition at line 1635 of file wallet.cpp.
bool wallet::CWallet::IsHDEnabled | ( | ) | const |
Definition at line 1652 of file wallet.cpp.
isminetype wallet::CWallet::IsMine | ( | const COutPoint & | outpoint | ) | const |
isminetype wallet::CWallet::IsMine | ( | const CScript & | script | ) | const |
bool wallet::CWallet::IsMine | ( | const CTransaction & | tx | ) | const |
isminetype wallet::CWallet::IsMine | ( | const CTxDestination & | dest | ) | const |
Definition at line 1589 of file wallet.cpp.
isminetype wallet::CWallet::IsMine | ( | const CTxOut & | txout | ) | const |
bool wallet::CWallet::IsSpent | ( | const COutPoint & | outpoint | ) | const |
Outpoint is spent if any non-conflicted transaction spends it:
Definition at line 771 of file wallet.cpp.
bool wallet::CWallet::IsSpentKey | ( | const CScript & | scriptPubKey | ) | const |
|
overridevirtual |
check if a certain wallet flag is set
Implements wallet::WalletStorage.
Definition at line 1709 of file wallet.cpp.
bool wallet::CWallet::LoadToWallet | ( | const Txid & | hash, |
const UpdateWalletTxFn & | fill_wtx | ||
) |
Definition at line 1159 of file wallet.cpp.
bool wallet::CWallet::LoadWalletFlags | ( | uint64_t | flags | ) |
Loads the flags into the wallet.
(used by LoadWallet)
Definition at line 1714 of file wallet.cpp.
|
private |
Mark a transaction (and its in-wallet descendants) as conflicting with a particular block.
Definition at line 1312 of file wallet.cpp.
void wallet::CWallet::MarkDirty | ( | ) |
Definition at line 958 of file wallet.cpp.
|
private |
Mark a transaction's inputs dirty, thus forcing the outputs to be recomputed.
Definition at line 1264 of file wallet.cpp.
Mark a transaction as replaced by another transaction.
Definition at line 967 of file wallet.cpp.
void wallet::CWallet::MaybeUpdateBirthTime | ( | int64_t | time | ) |
Updates wallet birth time if 'time' is below it.
Definition at line 1742 of file wallet.cpp.
|
private |
Mark a transaction (and its in-wallet descendants) as a particular tx state.
Definition at line 1342 of file wallet.cpp.
|
private |
DBErrors wallet::CWallet::ReorderTransactions | ( | ) |
Definition at line 889 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 1758 of file wallet.cpp.
void wallet::CWallet::ResubmitWalletTransactions | ( | bool | relay, |
bool | force | ||
) |
Definition at line 2036 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, | ||
const 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 1802 of file wallet.cpp.
void wallet::CWallet::SetLastBlockProcessed | ( | int | block_height, |
uint256 | block_hash | ||
) |
Set last block processed height, and write to database.
Definition at line 664 of file wallet.cpp.
|
private |
Definition at line 656 of file wallet.cpp.
|
overridevirtual |
signify that a particular wallet feature is now used.
Implements wallet::WalletStorage.
Definition at line 672 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 999 of file wallet.cpp.
void wallet::CWallet::SetWalletFlag | ( | uint64_t | flags | ) |
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 1676 of file wallet.cpp.
|
private |
Store wallet flags.
Definition at line 1682 of file wallet.cpp.
bool wallet::CWallet::ShouldResend | ( | ) | const |
Return true if all conditions for periodically resending transactions are met.
Definition at line 1993 of file wallet.cpp.
bool wallet::CWallet::SubmitTxMemoryPoolAndRelay | ( | CWalletTx & | wtx, |
std::string & | err_string, | ||
bool | relay | ||
) | const |
Pass this transaction to node for mempool insertion and relay to peers if flag set to true.
Definition at line 1953 of file wallet.cpp.
|
private |
Definition at line 729 of file wallet.cpp.
|
private |
Definition at line 1386 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1398 of file wallet.cpp.
bool wallet::CWallet::TransactionCanBeAbandoned | ( | const Txid & | hashTx | ) | const |
Return whether transaction can be abandoned.
Definition at line 1257 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1422 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 1704 of file wallet.cpp.
void wallet::CWallet::UnsetWalletFlag | ( | uint64_t | flag | ) |
Unsets a single wallet flag.
Definition at line 1690 of file wallet.cpp.
|
private |
Unsets a wallet flag and saves it to disk.
Definition at line 1696 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1550 of file wallet.cpp.
void wallet::CWallet::UpgradeDescriptorCache | ( | ) |
Upgrade DescriptorCaches.
Definition at line 548 of file wallet.cpp.