| 56 | } |
| 57 | |
| 58 | void CheckCache(const CBlock& block, const CCoinsViewCache& cache) |
| 59 | { |
| 60 | uint32_t counter{0}; |
| 61 | |
| 62 | for (const auto& tx : block.vtx) { |
| 63 | if (tx->IsCoinBase()) { |
| 64 | BOOST_CHECK(!cache.HaveCoinInCache(tx->vin[0].prevout)); |
| 65 | } else { |
| 66 | for (const auto& in : tx->vin) { |
| 67 | const auto& outpoint{in.prevout}; |
| 68 | const auto& first{cache.AccessCoin(outpoint)}; |
| 69 | const auto& second{cache.AccessCoin(outpoint)}; |
| 70 | BOOST_CHECK_EQUAL(&first, &second); |
| 71 | ++counter; |
| 72 | BOOST_CHECK(cache.HaveCoinInCache(outpoint)); |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | BOOST_CHECK_EQUAL(cache.GetCacheSize(), counter); |
| 77 | } |
| 78 | |
| 79 | } // namespace |
| 80 |
no test coverage detected