5#ifndef BITCOIN_WALLET_SCAN_H
6#define BITCOIN_WALLET_SCAN_H
39 using Clock = std::chrono::steady_clock;
40 using NowFn = std::function<Clock::time_point()>;
47 bool reserve(
bool with_passphrase =
false);
50 Clock::time_point
now()
const {
return m_now ?
m_now() : Clock::now(); };
80 bool QueueNextBlock(
const uint256& block_hash,
int block_height, std::optional<std::pair<uint256, int>>& next_block, std::optional<int> max_height);
81 bool ScanBlock(
const uint256& block_hash,
int block_height,
bool save_progress);
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
std::atomic< SteadyClock::time_point > m_scanning_start
void UpdateProgress(const LoopState &state, double progress_current, int block_height)
bool IsScanningWithPassphrase() const
SteadyClock::duration ScanningDuration() const
std::atomic< double > m_scanning_progress
void UpdateTipIfChanged(LoopState &state)
bool QueueNextBlock(const uint256 &block_hash, int block_height, std::optional< std::pair< uint256, int > > &next_block, std::optional< int > max_height)
Locate block_hash in the chain, queueing its active-chain successor into next_block if it exists and ...
bool ScanBlock(const uint256 &block_hash, int block_height, bool save_progress)
bool TryReserve(bool with_passphrase=false)
int64_t ScanFromTime(int64_t startTime, const WalletRescanReserver &reserver)
Scan active chain for relevant transactions after importing keys.
double ScanningProgress() const
ScanResult Scan(const uint256 &start_block, int start_height, std::optional< int > max_height, const WalletRescanReserver &reserver, bool save_progress)
Scan the block chain (starting in start_block) for transactions from or to us.
std::atomic< bool > m_scanning_with_passphrase
std::atomic< bool > m_scanning
std::atomic< bool > m_abort
ChainScanner(CWallet &wallet)
RAII object to check and reserve a wallet rescan.
std::function< Clock::time_point()> NowFn
std::chrono::steady_clock Clock
WalletRescanReserver(CWallet &w)
Clock::time_point now() const
bool reserve(bool with_passphrase=false)
Progress window and tip tracked across Scan loop iterations.
uint256 last_scanned_block
Hash and height of most recent block that was successfully scanned.
enum wallet::ScanResult::@19 status
std::optional< int > last_scanned_height
uint256 last_failed_block
Height of the most recent block that could not be scanned due to read errors or pruning.