mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
wallet: Track scanning duration
This commit is contained in:
parent
bdd7217f2c
commit
2ee811e693
1 changed files with 3 additions and 0 deletions
|
@ -596,6 +596,7 @@ class CWallet final : public CCryptoKeyStore, private interfaces::Chain::Notific
|
||||||
private:
|
private:
|
||||||
std::atomic<bool> fAbortRescan{false};
|
std::atomic<bool> fAbortRescan{false};
|
||||||
std::atomic<bool> fScanningWallet{false}; // controlled by WalletRescanReserver
|
std::atomic<bool> fScanningWallet{false}; // controlled by WalletRescanReserver
|
||||||
|
std::atomic<int64_t> m_scanning_start{0};
|
||||||
std::mutex mutexScanning;
|
std::mutex mutexScanning;
|
||||||
friend class WalletRescanReserver;
|
friend class WalletRescanReserver;
|
||||||
|
|
||||||
|
@ -820,6 +821,7 @@ public:
|
||||||
void AbortRescan() { fAbortRescan = true; }
|
void AbortRescan() { fAbortRescan = true; }
|
||||||
bool IsAbortingRescan() { return fAbortRescan; }
|
bool IsAbortingRescan() { return fAbortRescan; }
|
||||||
bool IsScanning() { return fScanningWallet; }
|
bool IsScanning() { return fScanningWallet; }
|
||||||
|
int64_t ScanningDuration() const { return fScanningWallet ? GetTimeMillis() - m_scanning_start : 0; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* keystore implementation
|
* keystore implementation
|
||||||
|
@ -1241,6 +1243,7 @@ public:
|
||||||
if (m_wallet->fScanningWallet) {
|
if (m_wallet->fScanningWallet) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
m_wallet->m_scanning_start = GetTimeMillis();
|
||||||
m_wallet->fScanningWallet = true;
|
m_wallet->fScanningWallet = true;
|
||||||
m_could_reserve = true;
|
m_could_reserve = true;
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue