Make it interruptible, so that shutdown doesn't block for up to one hour.
Fixes (partially) #13217
Make it interruptible, so that shutdown doesn't block for up to one hour.
Fixes (partially) #13217
Also, add interruption points to scantxoutset
Can be tested with the cli:
$ ./src/bitcoin-cli -datadir=/run/media/marco/b_re/TEMP_del//bt gettxoutsetinfo
error code: -9
error message:
Shutting down
Concept ACK.
@MarcoFalke mind looking into #17659 ?
Concept ACK.
29 | @@ -29,6 +30,6 @@ struct CCoinsStats 30 | }; 31 | 32 | //! Calculate statistics about the unspent transaction output set 33 | -bool GetUTXOStats(CCoinsView* view, CCoinsStats& stats); 34 | +bool GetUTXOStats(CCoinsView* view, CCoinsStats& stats, const std::function<void()>& interruption_point = {});
Is default = {} really needed?
Yes, otherwise all callers are forced to specify an interruption op
See for example:
$ git grep --extended-regexp 'GetUTXOStats\([^,]+,[^,]+\)'
src/test/fuzz/coins_view.cpp: (void)GetUTXOStats(&coins_view_cache, stats);
While touching the body of FindScriptPubKey() is it a good chance to make it static?
Code review ACK fa756928c3f455943086051c5fe1d5bb09962248