Return whether the completed full flush should compact chainstate
| 115 | |
| 116 | // Return whether the completed full flush should compact chainstate |
| 117 | static bool ShouldCompactChainstate(bool in_ibd) |
| 118 | { |
| 119 | static constexpr uint32_t flush_ratio{320}; // Roughly every 2 weeks with hourly flushes |
| 120 | return !in_ibd && FastRandomContext().randrange(flush_ratio) == 0; |
| 121 | } |
| 122 | |
| 123 | TRACEPOINT_SEMAPHORE(validation, block_connected); |
| 124 | TRACEPOINT_SEMAPHORE(utxocache, flush); |
no test coverage detected