#include <scan.h>
|
| struct | LoopState |
| | Progress window and tip tracked across Scan loop iterations. More...
|
| |
Definition at line 57 of file scan.h.
◆ ChainScanner()
| wallet::ChainScanner::ChainScanner |
( |
CWallet & |
wallet | ) |
|
|
inlineexplicit |
◆ Abort()
| void wallet::ChainScanner::Abort |
( |
| ) |
|
|
inline |
◆ IsAborting()
| bool wallet::ChainScanner::IsAborting |
( |
| ) |
const |
|
inline |
◆ IsScanning()
| bool wallet::ChainScanner::IsScanning |
( |
| ) |
const |
|
inline |
◆ IsScanningWithPassphrase()
| bool wallet::ChainScanner::IsScanningWithPassphrase |
( |
| ) |
const |
|
inline |
◆ QueueNextBlock()
| bool wallet::ChainScanner::QueueNextBlock |
( |
const uint256 & |
block_hash, |
|
|
int |
block_height, |
|
|
std::optional< std::pair< uint256, int > > & |
next_block, |
|
|
std::optional< int > |
max_height |
|
) |
| |
|
private |
Locate block_hash in the chain, queueing its active-chain successor into next_block if it exists and is within the scan range.
Returns whether the block itself is still in the active chain.
Definition at line 148 of file scan.cpp.
◆ Release()
| void wallet::ChainScanner::Release |
( |
| ) |
|
|
private |
◆ Scan()
Scan the block chain (starting in start_block) for transactions from or to us.
If max_height is not set, the mempool will be scanned as well.
- Parameters
-
| [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 |
- Returns
- ScanResult returning scan information and indicating success or failure. Return status will be set to SUCCESS if scan was successful. FAILURE if a complete rescan was not possible (due to pruning or corruption). USER_ABORT if the rescan was aborted before it could complete.
- Precondition
- Caller needs to make sure start_block (and the optional stop_block) are on the main chain after the addition of any new keys you want to detect transactions for.
Definition at line 218 of file scan.cpp.
◆ ScanBlock()
| bool wallet::ChainScanner::ScanBlock |
( |
const uint256 & |
block_hash, |
|
|
int |
block_height, |
|
|
bool |
save_progress |
|
) |
| |
|
private |
◆ ScanFromTime()
| int64_t wallet::ChainScanner::ScanFromTime |
( |
int64_t |
startTime, |
|
|
const WalletRescanReserver & |
reserver |
|
) |
| |
Scan active chain for relevant transactions after importing keys.
Should be called whenever new keys are added to the wallet, with the oldest key creation time.
- Returns
- Earliest timestamp that could be successfully scanned from. Timestamp returned will be higher than startTime if relevant blocks could not be read.
Definition at line 18 of file scan.cpp.
◆ ScanningDuration()
| SteadyClock::duration wallet::ChainScanner::ScanningDuration |
( |
| ) |
const |
|
inline |
◆ ScanningProgress()
| double wallet::ChainScanner::ScanningProgress |
( |
| ) |
const |
|
inline |
◆ TryReserve()
| bool wallet::ChainScanner::TryReserve |
( |
bool |
with_passphrase = false | ) |
|
|
private |
◆ UpdateProgress()
| void wallet::ChainScanner::UpdateProgress |
( |
const LoopState & |
state, |
|
|
double |
progress_current, |
|
|
int |
block_height |
|
) |
| |
|
private |
◆ UpdateTipIfChanged()
| void wallet::ChainScanner::UpdateTipIfChanged |
( |
LoopState & |
state | ) |
|
|
private |
◆ WalletRescanReserver
Only WalletRescanReserver may reserve and release scans, so that reservations are always managed RAII-style.
Definition at line 87 of file scan.h.
◆ m_abort
| std::atomic<bool> wallet::ChainScanner::m_abort {false} |
|
private |
◆ m_scanning
| std::atomic<bool> wallet::ChainScanner::m_scanning {false} |
|
private |
◆ m_scanning_progress
| std::atomic<double> wallet::ChainScanner::m_scanning_progress {0} |
|
private |
◆ m_scanning_start
| std::atomic<SteadyClock::time_point> wallet::ChainScanner::m_scanning_start {SteadyClock::time_point{}} |
|
private |
◆ m_scanning_with_passphrase
| std::atomic<bool> wallet::ChainScanner::m_scanning_with_passphrase {false} |
|
private |
◆ m_wallet
| CWallet& wallet::ChainScanner::m_wallet |
|
private |
The documentation for this class was generated from the following files: