Bitcoin ABC 0.26.3
P2P Digital Currency
|
Mark a transaction (and it in-wallet descendants) as abandoned so its inputs may be respent.
Definition at line 1170 of file wallet.cpp.
Definition at line 682 of file wallet.cpp.
CWalletTx * CWallet::AddToWallet | ( | CTransactionRef | tx, |
const CWalletTx::Confirmation & | confirm, | ||
const UpdateWalletTxFn & | update_wtx = nullptr , |
||
bool | fFlushOnClose = true |
||
) |
Definition at line 952 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.
Check if any keys in the wallet keypool that were supposed to be unused have appeared in a new transaction. If so, remove those keys from the keypool. This can happen when restoring an old wallet backup that does not contain the mostly recently created transactions from newer versions of the wallet.
Definition at line 1097 of file wallet.cpp.
Overwrite all flags by the given uint64_t.
Returns false if unknown, non-tolerable flags are present.
Definition at line 1532 of file wallet.cpp.
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1354 of file wallet.cpp.
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1369 of file wallet.cpp.
Returns true if the wallet can give out new addresses.
This means it has keys in the keypool or can generate new keys.
Definition at line 1476 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 523 of file wallet.cpp.
bool CWallet::ChangeWalletPassphrase | ( | const SecureString & | strOldWalletPassphrase, |
const SecureString & | strNewWalletPassphrase | ||
) |
Definition at line 446 of file wallet.cpp.
void CWallet::Close | ( | ) |
Close wallet database.
Definition at line 608 of file wallet.cpp.
bool CWallet::DummySignInput | ( | CTxIn & | tx_in, |
const CTxOut & | txout, | ||
bool | use_max_sig = false |
||
) | const |
Definition at line 1546 of file wallet.cpp.
bool CWallet::DummySignTx | ( | CMutableTransaction & | txNew, |
const std::vector< CTxOut > & | txouts, | ||
bool | use_max_sig = false |
||
) | const |
bool CWallet::EncryptWallet | ( | const SecureString & | strWalletPassphrase | ) |
Definition at line 706 of file wallet.cpp.
void CWallet::Flush | ( | ) |
Flush wallet (bitdb flush)
Definition at line 604 of file wallet.cpp.
|
overridevirtual |
Implements WalletStorage.
Definition at line 386 of file wallet.cpp.
Get wallet transactions that conflict with given transaction (spend same outputs)
Definition at line 569 of file wallet.cpp.
Amount CWallet::GetDebit | ( | const CTransaction & | tx, |
const isminefilter & | filter | ||
) | const |
Amount 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 1403 of file wallet.cpp.
Check if a given transaction has any of its outputs spent by another transaction in the wallet.
Definition at line 598 of file wallet.cpp.
bool CWallet::ImportPrivKeys | ( | const std::map< CKeyID, CKey > & | privkey_map, |
const int64_t | timestamp | ||
) |
Definition at line 1597 of file wallet.cpp.
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 | ||
) |
Definition at line 1607 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 1621 of file wallet.cpp.
Definition at line 1587 of file wallet.cpp.
int64_t CWallet::IncOrderPosNext | ( | WalletBatch * | batch = nullptr | ) |
Increment the next transaction order id.
Definition at line 882 of file wallet.cpp.
bool CWallet::IsFromMe | ( | const CTransaction & | tx | ) | const |
should probably be renamed to IsRelevantToMe
Definition at line 1449 of file wallet.cpp.
bool CWallet::IsHDEnabled | ( | ) | const |
isminetype CWallet::IsMine | ( | const CScript & | script | ) | const |
bool CWallet::IsMine | ( | const CTransaction & | tx | ) | const |
isminetype CWallet::IsMine | ( | const CTxDestination & | dest | ) | const |
Definition at line 1424 of file wallet.cpp.
isminetype CWallet::IsMine | ( | const CTxOut & | txout | ) | const |
Outpoint is spent if any non-conflicted transaction, spends it:
Definition at line 661 of file wallet.cpp.
Definition at line 925 of file wallet.cpp.
Check if a certain wallet flag is set.
Implements WalletStorage.
Definition at line 1517 of file wallet.cpp.
bool CWallet::LoadToWallet | ( | const TxId & | txid, |
const UpdateWalletTxFn & | fill_wtx | ||
) |
Definition at line 1046 of file wallet.cpp.
Loads the flags into the wallet.
(used by LoadWallet)
Definition at line 1521 of file wallet.cpp.
|
private |
Mark a transaction (and its in-wallet descendants) as conflicting with a particular block.
Definition at line 1229 of file wallet.cpp.
void CWallet::MarkDirty | ( | ) |
|
private |
Mark a transaction's inputs dirty, thus forcing the outputs to be recomputed.
Definition at line 1161 of file wallet.cpp.
void CWallet::ReacceptWalletTransactions | ( | ) |
Definition at line 1848 of file wallet.cpp.
DBErrors CWallet::ReorderTransactions | ( | ) |
Definition at line 826 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 1656 of file wallet.cpp.
void CWallet::ResendWalletTransactions | ( | ) |
CWallet::ScanResult CWallet::ScanForWalletTransactions | ( | const BlockHash & | start_block, |
int | start_height, | ||
std::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 1707 of file wallet.cpp.
change which version we're allowed to upgrade to (note that this does not immediately imply upgrading to that format)
Definition at line 556 of file wallet.cpp.
|
overridevirtual |
signify that a particular wallet feature is now used.
this may change nWalletVersion and nWalletMaxVersion if those are lower
Implements WalletStorage.
Definition at line 528 of file wallet.cpp.
void CWallet::SetSpentKeyState | ( | WalletBatch & | batch, |
const TxId & | txid, | ||
unsigned int | n, | ||
bool | used, | ||
std::set< CTxDestination > & | tx_destinations | ||
) |
Definition at line 901 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 1490 of file wallet.cpp.
bool CWallet::SubmitTxMemoryPoolAndRelay | ( | const 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 1881 of file wallet.cpp.
|
private |
Definition at line 612 of file wallet.cpp.
|
private |
Used by TransactionAddedToMemorypool/BlockConnected/Disconnected/ScanForWalletTransactions.
Should be called with non-zero block_hash and posInBlock if this is for a transaction that is included in a block.
Definition at line 1286 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1299 of file wallet.cpp.
Return whether transaction can be abandoned.
Definition at line 1154 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1312 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 1513 of file wallet.cpp.
Unsets a single wallet flag.
Definition at line 1499 of file wallet.cpp.
|
private |
Unsets a wallet flag and saves it to disk.
Definition at line 1504 of file wallet.cpp.
|
overridevirtual |
Reimplemented from interfaces::Chain::Notifications.
Definition at line 1386 of file wallet.cpp.
void CWallet::UpgradeKeyMetadata | ( | ) |
Upgrade stored CKeyMetadata objects to store key origin info as KeyOriginInfo.
Definition at line 402 of file wallet.cpp.