| 270 | } |
| 271 | |
| 272 | void CCoinsViewCache::Sync() |
| 273 | { |
| 274 | auto cursor{CoinsViewCacheCursor(m_dirty_count, m_sentinel, cacheCoins, /*will_erase=*/false)}; |
| 275 | base->BatchWrite(cursor, m_block_hash); |
| 276 | Assume(m_dirty_count == 0); |
| 277 | if (m_sentinel.second.Next() != &m_sentinel) { |
| 278 | /* BatchWrite must clear flags of all entries */ |
| 279 | throw std::logic_error("Not all unspent flagged entries were cleared"); |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | void CCoinsViewCache::Reset() noexcept |
| 284 | { |
no test coverage detected