diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-05-22 16:09:34 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-05-22 15:53:50 -0400 |
commit | fa756928c3f455943086051c5fe1d5bb09962248 (patch) | |
tree | 93ed8e1324b591bdf17e0cdac6488140994025b5 /src/node/coinstats.cpp | |
parent | fa7fc5a8e0fcf9ca81e84b3631f18ae40502be60 (diff) | |
download | bitcoin-fa756928c3f455943086051c5fe1d5bb09962248.tar.xz |
rpc: Make gettxoutsetinfo/GetUTXOStats interruptible
Also, add interruption points to scantxoutset
Diffstat (limited to 'src/node/coinstats.cpp')
-rw-r--r-- | src/node/coinstats.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node/coinstats.cpp b/src/node/coinstats.cpp index ec52a08ace..e3c4c828b6 100644 --- a/src/node/coinstats.cpp +++ b/src/node/coinstats.cpp @@ -33,7 +33,7 @@ static void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash, } //! Calculate statistics about the unspent transaction output set -bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats) +bool GetUTXOStats(CCoinsView* view, CCoinsStats& stats, const std::function<void()>& interruption_point) { stats = CCoinsStats(); std::unique_ptr<CCoinsViewCursor> pcursor(view->Cursor()); @@ -49,6 +49,7 @@ bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats) uint256 prevkey; std::map<uint32_t, Coin> outputs; while (pcursor->Valid()) { + interruption_point(); COutPoint key; Coin coin; if (pcursor->GetKey(key) && pcursor->GetValue(coin)) { |