diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-04-03 16:57:24 +0100 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-04-28 11:14:54 +0100 |
commit | 2ee811e6930cf76ea51e6826fe437ed888688adc (patch) | |
tree | 1ae83bbd6714807c7f8ebc328a173d5af5072263 /src/wallet/wallet.h | |
parent | bdd7217f2c03007ce1df85cd9a750d1893d88cdc (diff) | |
download | bitcoin-2ee811e6930cf76ea51e6826fe437ed888688adc.tar.xz |
wallet: Track scanning duration
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r-- | src/wallet/wallet.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 900af75f4f..fa9a13bebb 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -596,6 +596,7 @@ class CWallet final : public CCryptoKeyStore, private interfaces::Chain::Notific private: std::atomic<bool> fAbortRescan{false}; std::atomic<bool> fScanningWallet{false}; // controlled by WalletRescanReserver + std::atomic<int64_t> m_scanning_start{0}; std::mutex mutexScanning; friend class WalletRescanReserver; @@ -820,6 +821,7 @@ public: void AbortRescan() { fAbortRescan = true; } bool IsAbortingRescan() { return fAbortRescan; } bool IsScanning() { return fScanningWallet; } + int64_t ScanningDuration() const { return fScanningWallet ? GetTimeMillis() - m_scanning_start : 0; } /** * keystore implementation @@ -1241,6 +1243,7 @@ public: if (m_wallet->fScanningWallet) { return false; } + m_wallet->m_scanning_start = GetTimeMillis(); m_wallet->fScanningWallet = true; m_could_reserve = true; return true; |