![]() |
Bitcoin Core
21.99.0
P2P Digital Currency
|
Functions | |
int64_t | CalculateMaximumSignedTxSize (const CTransaction &tx, const CWallet *wallet, bool use_max_sig) |
int64_t | CalculateMaximumSignedTxSize (const CTransaction &tx, const CWallet *wallet, const std::vector< CTxOut > &txouts, bool use_max_sig) |
int | CalculateMaximumSignedInputSize (const CTxOut &txout, const CWallet *wallet, bool use_max_sig) |
std::string | COutput::ToString () const |
const CWalletTx * | CWallet::GetWalletTx (const uint256 &hash) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
void | CWallet::UpgradeKeyMetadata () EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Upgrade stored CKeyMetadata objects to store key origin info as KeyOriginInfo. More... | |
bool | CWallet::Unlock (const SecureString &strWalletPassphrase, bool accept_no_keys=false) |
bool | CWallet::ChangeWalletPassphrase (const SecureString &strOldWalletPassphrase, const SecureString &strNewWalletPassphrase) |
void | CWallet::chainStateFlushed (const CBlockLocator &loc) override |
void | CWallet::SetMinVersion (enum WalletFeature, WalletBatch *batch_in=nullptr) override |
signify that a particular wallet feature is now used. More... | |
std::set< uint256 > | CWallet::GetConflicts (const uint256 &txid) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Get wallet transactions that conflict with given transaction (spend same outputs) More... | |
bool | CWallet::HasWalletSpend (const uint256 &txid) 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 | CWallet::Flush () |
Flush wallet (bitdb flush) More... | |
void | CWallet::Close () |
Close wallet database. More... | |
void | CWallet::SyncMetaData (std::pair< TxSpends::iterator, TxSpends::iterator >) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWallet::IsSpent (const uint256 &hash, unsigned int n) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Outpoint is spent if any non-conflicted transaction spends it: More... | |
void | CWallet::AddToSpends (const COutPoint &outpoint, const uint256 &wtxid) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
void | CWallet::AddToSpends (const uint256 &wtxid) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWallet::EncryptWallet (const SecureString &strWalletPassphrase) |
DBErrors | CWallet::ReorderTransactions () |
int64_t | CWallet::IncOrderPosNext (WalletBatch *batch=nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Increment the next transaction order id. More... | |
void | CWallet::MarkDirty () |
bool | CWallet::MarkReplaced (const uint256 &originalHash, const uint256 &newHash) |
Mark a transaction as replaced by another transaction (e.g., BIP 125). More... | |
void | CWallet::SetSpentKeyState (WalletBatch &batch, const uint256 &hash, unsigned int n, bool used, std::set< CTxDestination > &tx_destinations) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWallet::IsSpentKey (const uint256 &hash, unsigned int n) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
CWalletTx * | CWallet::AddToWallet (CTransactionRef tx, const CWalletTx::Confirmation &confirm, const UpdateWalletTxFn &update_wtx=nullptr, bool fFlushOnClose=true) |
bool | CWallet::LoadToWallet (const uint256 &hash, const UpdateWalletTxFn &fill_wtx) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWallet::AddToWalletIfInvolvingMe (const CTransactionRef &tx, CWalletTx::Confirmation confirm, bool fUpdate) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
Add a transaction to the wallet, or update it. More... | |
bool | CWallet::TransactionCanBeAbandoned (const uint256 &hashTx) const |
Return whether transaction can be abandoned. More... | |
void | CWallet::MarkInputsDirty (const CTransactionRef &tx) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWallet::AbandonTransaction (const uint256 &hashTx) |
void | CWallet::MarkConflicted (const uint256 &hashBlock, int conflicting_height, const uint256 &hashTx) |
void | CWallet::SyncTransaction (const CTransactionRef &tx, CWalletTx::Confirmation confirm, bool update_tx=true) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
void | CWallet::transactionAddedToMempool (const CTransactionRef &tx, uint64_t mempool_sequence) override |
void | CWallet::transactionRemovedFromMempool (const CTransactionRef &tx, MemPoolRemovalReason reason, uint64_t mempool_sequence) override |
void | CWallet::blockConnected (const CBlock &block, int height) override |
void | CWallet::blockDisconnected (const CBlock &block, int height) override |
void | CWallet::updatedBlockTip () override |
isminetype | CWallet::IsMine (const CTxIn &txin) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
CAmount | CWallet::GetDebit (const CTxIn &txin, const isminefilter &filter) const |
Returns amount of debit if the input matches the filter, otherwise returns 0. More... | |
isminetype | CWallet::IsMine (const CTxOut &txout) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
isminetype | CWallet::IsMine (const CTxDestination &dest) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
isminetype | CWallet::IsMine (const CScript &script) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
CAmount | CWallet::GetCredit (const CTxOut &txout, const isminefilter &filter) const |
bool | CWallet::IsChange (const CTxOut &txout) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWallet::IsChange (const CScript &script) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
CAmount | CWallet::GetChange (const CTxOut &txout) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWallet::IsMine (const CTransaction &tx) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWallet::IsFromMe (const CTransaction &tx) const |
should probably be renamed to IsRelevantToMe More... | |
CAmount | CWallet::GetDebit (const CTransaction &tx, const isminefilter &filter) const |
bool | CWallet::IsAllFromMe (const CTransaction &tx, const isminefilter &filter) const |
Returns whether all of the inputs match the filter. More... | |
CAmount | CWallet::GetCredit (const CTransaction &tx, const isminefilter &filter) const |
CAmount | CWallet::GetChange (const CTransaction &tx) const |
bool | CWallet::IsHDEnabled () const |
bool | CWallet::CanGetAddresses (bool internal=false) const |
void BlockUntilSyncedToCurrentChain() const EXCLUSIVE_LOCKS_REQUIRED(! void | 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 | CWallet::UnsetWalletFlag (uint64_t flag) |
Unsets a single wallet flag. More... | |
void | CWallet::UnsetWalletFlagWithDB (WalletBatch &batch, uint64_t flag) |
Unsets a wallet flag and saves it to disk. More... | |
void | CWallet::UnsetBlankWalletFlag (WalletBatch &batch) override |
Unset the blank wallet flag and saves it to disk. More... | |
bool | CWallet::IsWalletFlagSet (uint64_t flag) const override |
check if a certain wallet flag is set More... | |
bool | CWallet::LoadWalletFlags (uint64_t flags) |
Loads the flags into the wallet. More... | |
bool | CWallet::AddWalletFlags (uint64_t flags) |
overwrite all flags by the given uint64_t returns false if unknown, non-tolerable flags are present More... | |
int64_t | CWalletTx::GetTxTime () const |
bool | CWallet::DummySignInput (CTxIn &tx_in, const CTxOut &txout, bool use_max_sig=false) const |
bool | CWallet::DummySignTx (CMutableTransaction &txNew, const std::vector< CTxOut > &txouts, bool use_max_sig=false) const |
bool | CWallet::ImportScripts (const std::set< CScript > scripts, int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWallet::ImportPrivKeys (const std::map< CKeyID, CKey > &privkey_map, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWallet::ImportPubKeys (const std::vector< CKeyID > &ordered_pubkeys, const std::map< CKeyID, CPubKey > &pubkey_map, const std::map< CKeyID, std::pair< CPubKey, KeyOriginInfo >> &key_origins, const bool add_keypool, const bool internal, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWallet::ImportScriptPubKeys (const std::string &label, const std::set< CScript > &script_pub_keys, const bool have_solving_data, const bool apply_label, const int64_t timestamp) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
void | CWalletTx::GetAmounts (std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, const isminefilter &filter) const |
int64_t | CWallet::RescanFromTime (int64_t startTime, const WalletRescanReserver &reserver, bool update) |
Scan active chain for relevant transactions after importing keys. More... | |
ScanResult | CWallet::ScanForWalletTransactions (const uint256 &start_block, int start_height, Optional< int > max_height, const WalletRescanReserver &reserver, bool fUpdate) |
Scan the block chain (starting in start_block) for transactions from or to us. More... | |
void | CWallet::ReacceptWalletTransactions () EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWalletTx::SubmitMemoryPoolAndRelay (std::string &err_string, bool relay) |
std::set< uint256 > | CWalletTx::GetConflicts () const NO_THREAD_SAFETY_ANALYSIS |
CAmount | CWalletTx::GetCachableAmount (AmountType type, const isminefilter &filter, bool recalculate=false) const |
CAmount | CWalletTx::GetDebit (const isminefilter &filter) const |
filter decides which addresses will count towards the debit More... | |
CAmount | CWalletTx::GetCredit (const isminefilter &filter) const |
CAmount | CWalletTx::GetImmatureCredit (bool fUseCache=true) const |
CAmount | CWalletTx::GetAvailableCredit (bool fUseCache=true, const isminefilter &filter=ISMINE_SPENDABLE) const NO_THREAD_SAFETY_ANALYSIS |
CAmount | CWalletTx::GetImmatureWatchOnlyCredit (const bool fUseCache=true) const |
CAmount | CWalletTx::GetChange () const |
bool | CWalletTx::InMempool () const |
bool | CWalletTx::IsTrusted () const |
bool | CWallet::IsTrusted (const CWalletTx &wtx, std::set< uint256 > &trusted_parents) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet) |
bool | CWalletTx::IsEquivalentTo (const CWalletTx &tx) const |
void | CWallet::ResendWalletTransactions () |
bool CWallet::AbandonTransaction | ( | const uint256 & | hashTx | ) |
Definition at line 1045 of file wallet.cpp.
Definition at line 557 of file wallet.cpp.
|
private |
CWalletTx * CWallet::AddToWallet | ( | CTransactionRef | tx, |
const CWalletTx::Confirmation & | confirm, | ||
const UpdateWalletTxFn & | update_wtx = nullptr , |
||
bool | fFlushOnClose = true |
||
) |
Definition at line 845 of file wallet.cpp.
|
private |
Add a transaction to the wallet, or update it.
pIndex and posInBlock should be set when the transaction was known to be included in a block. When pIndex == nullptr, 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 posInBlock signals or by checking mempool presence when necessary.
Definition at line 984 of file wallet.cpp.
bool CWallet::AddWalletFlags | ( | uint64_t | flags | ) |
overwrite all flags by the given uint64_t returns false if unknown, non-tolerable flags are present
Definition at line 1489 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1209 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1222 of file wallet.cpp.
int CalculateMaximumSignedInputSize | ( | const CTxOut & | txout, |
const CWallet * | wallet, | ||
bool | use_max_sig | ||
) |
Definition at line 1622 of file wallet.cpp.
int64_t CalculateMaximumSignedTxSize | ( | const CTransaction & | tx, |
const CWallet * | wallet, | ||
bool | use_max_sig | ||
) |
Definition at line 1597 of file wallet.cpp.
int64_t CalculateMaximumSignedTxSize | ( | const CTransaction & | tx, |
const CWallet * | wallet, | ||
const std::vector< CTxOut > & | txouts, | ||
bool | use_max_sig | ||
) |
bool CWallet::CanGetAddresses | ( | bool | internal = false | ) | const |
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 433 of file wallet.cpp.
bool CWallet::ChangeWalletPassphrase | ( | const SecureString & | strOldWalletPassphrase, |
const SecureString & | strNewWalletPassphrase | ||
) |
Definition at line 387 of file wallet.cpp.
void CWallet::Close | ( | ) |
Close wallet database.
Definition at line 490 of file wallet.cpp.
bool CWallet::DummySignInput | ( | CTxIn & | tx_in, |
const CTxOut & | txout, | ||
bool | use_max_sig = false |
||
) | const |
Definition at line 1509 of file wallet.cpp.
bool CWallet::DummySignTx | ( | CMutableTransaction & | txNew, |
const std::vector< CTxOut > & | txouts, | ||
bool | use_max_sig = false |
||
) | const |
Definition at line 1529 of file wallet.cpp.
bool CWallet::EncryptWallet | ( | const SecureString & | strWalletPassphrase | ) |
Definition at line 581 of file wallet.cpp.
void CWallet::Flush | ( | ) |
Flush wallet (bitdb flush)
Definition at line 485 of file wallet.cpp.
void CWalletTx::GetAmounts | ( | std::list< COutputEntry > & | listReceived, |
std::list< COutputEntry > & | listSent, | ||
CAmount & | nFee, | ||
const isminefilter & | filter | ||
) | const |
CAmount CWalletTx::GetAvailableCredit | ( | bool | fUseCache = true , |
const isminefilter & | filter = ISMINE_SPENDABLE |
||
) | const |
Definition at line 1961 of file wallet.cpp.
CAmount CWalletTx::GetCachableAmount | ( | AmountType | type, |
const isminefilter & | filter, | ||
bool | recalculate = false |
||
) | const |
Definition at line 1910 of file wallet.cpp.
CAmount CWalletTx::GetChange | ( | ) | const |
Definition at line 2007 of file wallet.cpp.
CAmount CWallet::GetChange | ( | const CTransaction & | tx | ) | const |
std::set< uint256 > CWalletTx::GetConflicts | ( | ) | const |
Get wallet transactions that conflict with given transaction (spend same outputs)
Definition at line 455 of file wallet.cpp.
CAmount CWalletTx::GetCredit | ( | const isminefilter & | filter | ) | const |
CAmount CWallet::GetCredit | ( | const CTxOut & | txout, |
const isminefilter & | filter | ||
) | const |
CAmount CWallet::GetCredit | ( | const CTransaction & | tx, |
const isminefilter & | filter | ||
) | const |
CAmount CWalletTx::GetDebit | ( | const isminefilter & | filter | ) | const |
filter decides which addresses will count towards the debit
Definition at line 1920 of file wallet.cpp.
CAmount 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 1269 of file wallet.cpp.
CAmount CWallet::GetDebit | ( | const CTransaction & | tx, |
const isminefilter & | filter | ||
) | const |
CAmount CWalletTx::GetImmatureCredit | ( | bool | fUseCache = true | ) | const |
CAmount CWalletTx::GetImmatureWatchOnlyCredit | ( | const bool | fUseCache = true | ) | const |
int64_t CWalletTx::GetTxTime | ( | ) | const |
bool CWallet::HasWalletSpend | ( | const uint256 & | txid | ) | const |
Check if a given transaction has any of its outputs spent by another transaction in the wallet.
Definition at line 478 of file wallet.cpp.
bool CWallet::ImportScriptPubKeys | ( | const std::string & | label, |
const std::set< CScript > & | script_pub_keys, | ||
const bool | have_solving_data, | ||
const bool | apply_label, | ||
const int64_t | timestamp | ||
) |
Definition at line 1574 of file wallet.cpp.
bool CWallet::ImportScripts | ( | const std::set< CScript > | scripts, |
int64_t | timestamp | ||
) |
int64_t CWallet::IncOrderPosNext | ( | WalletBatch * | batch = nullptr | ) |
Increment the next transaction order id.
Definition at line 740 of file wallet.cpp.
bool CWalletTx::InMempool | ( | ) | const |
bool CWallet::IsAllFromMe | ( | const CTransaction & | tx, |
const isminefilter & | filter | ||
) | const |
Returns whether all of the inputs match the filter.
Definition at line 1376 of file wallet.cpp.
bool CWallet::IsChange | ( | const CTxOut & | txout | ) | const |
bool CWallet::IsChange | ( | const CScript & | script | ) | const |
bool CWalletTx::IsEquivalentTo | ( | const CWalletTx & | tx | ) | const |
bool CWallet::IsFromMe | ( | const CTransaction & | tx | ) | const |
should probably be renamed to IsRelevantToMe
Definition at line 1359 of file wallet.cpp.
bool CWallet::IsHDEnabled | ( | ) | const |
isminetype CWallet::IsMine | ( | const CTxDestination & | dest | ) | const |
Definition at line 1291 of file wallet.cpp.
isminetype CWallet::IsMine | ( | const CScript & | script | ) | const |
Definition at line 1297 of file wallet.cpp.
isminetype CWallet::IsMine | ( | const CTxIn & | txin | ) | const |
Definition at line 1254 of file wallet.cpp.
isminetype CWallet::IsMine | ( | const CTxOut & | txout | ) | const |
Definition at line 1285 of file wallet.cpp.
bool CWallet::IsMine | ( | const CTransaction & | tx | ) | const |
Definition at line 1350 of file wallet.cpp.
bool CWallet::IsSpent | ( | const uint256 & | hash, |
unsigned int | n | ||
) | const |
Outpoint is spent if any non-conflicted transaction spends it:
Definition at line 538 of file wallet.cpp.
bool CWallet::IsSpentKey | ( | const uint256 & | hash, |
unsigned int | n | ||
) | const |
Definition at line 810 of file wallet.cpp.
bool CWalletTx::IsTrusted | ( | ) | const |
|
overridevirtual |
check if a certain wallet flag is set
Implements WalletStorage.
Definition at line 1472 of file wallet.cpp.
bool CWallet::LoadToWallet | ( | const uint256 & | hash, |
const UpdateWalletTxFn & | fill_wtx | ||
) |
Definition at line 940 of file wallet.cpp.
bool CWallet::LoadWalletFlags | ( | uint64_t | flags | ) |
Loads the flags into the wallet.
(used by LoadWallet)
Definition at line 1477 of file wallet.cpp.
void CWallet::MarkDirty | ( | ) |
|
private |
Definition at line 1035 of file wallet.cpp.
Mark a transaction as replaced by another transaction (e.g., BIP 125).
Definition at line 761 of file wallet.cpp.
void CWallet::ReacceptWalletTransactions | ( | ) |
Definition at line 1842 of file wallet.cpp.
DBErrors CWallet::ReorderTransactions | ( | ) |
Definition at line 683 of file wallet.cpp.
int64_t 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 1696 of file wallet.cpp.
void CWallet::ResendWalletTransactions | ( | ) |
CWallet::ScanResult CWallet::ScanForWalletTransactions | ( | const uint256 & | start_block, |
int | start_height, | ||
Optional< int > | max_height, | ||
const WalletRescanReserver & | reserver, | ||
bool | fUpdate | ||
) |
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.
[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 1739 of file wallet.cpp.
|
overridevirtual |
signify that a particular wallet feature is now used.
Implements WalletStorage.
Definition at line 439 of file wallet.cpp.
void CWallet::SetSpentKeyState | ( | WalletBatch & | batch, |
const uint256 & | hash, | ||
unsigned int | n, | ||
bool | used, | ||
std::set< CTxDestination > & | tx_destinations | ||
) |
void CWallet::SetWalletFlag | ( | uint64_t | flags | ) | const |
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 1445 of file wallet.cpp.
bool CWalletTx::SubmitMemoryPoolAndRelay | ( | std::string & | err_string, |
bool | relay | ||
) |
Definition at line 1870 of file wallet.cpp.
|
private |
|
private |
Definition at line 1151 of file wallet.cpp.
std::string COutput::ToString | ( | ) | const |
Definition at line 335 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1162 of file wallet.cpp.
bool CWallet::TransactionCanBeAbandoned | ( | const uint256 & | hashTx | ) | const |
Return whether transaction can be abandoned.
Definition at line 1028 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1172 of file wallet.cpp.
bool CWallet::Unlock | ( | const SecureString & | strWalletPassphrase, |
bool | accept_no_keys = false |
||
) |
|
overrideprivatevirtual |
Unset the blank wallet flag and saves it to disk.
Implements WalletStorage.
Definition at line 1467 of file wallet.cpp.
void CWallet::UnsetWalletFlag | ( | uint64_t | flag | ) |
Unsets a single wallet flag.
Definition at line 1453 of file wallet.cpp.
|
private |
Unsets a wallet flag and saves it to disk.
Definition at line 1459 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1237 of file wallet.cpp.
void CWallet::UpgradeKeyMetadata | ( | ) |
Upgrade stored CKeyMetadata objects to store key origin info as KeyOriginInfo.
Definition at line 349 of file wallet.cpp.