| 40 | } |
| 41 | |
| 42 | void PopulateView(const CBlock& block, CCoinsView& view, bool spent = false) |
| 43 | { |
| 44 | CCoinsViewCache cache{&view}; |
| 45 | cache.SetBestBlock(uint256::ONE); |
| 46 | |
| 47 | for (const auto& tx : block.vtx | std::views::drop(1)) { |
| 48 | for (const auto& in : tx->vin) { |
| 49 | Coin coin{}; |
| 50 | if (!spent) coin.out.nValue = 1; |
| 51 | cache.EmplaceCoinInternalDANGER(COutPoint{in.prevout}, std::move(coin)); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | cache.Flush(); |
| 56 | } |
| 57 | |
| 58 | void CheckCache(const CBlock& block, const CCoinsViewCache& cache) |
| 59 | { |
no test coverage detected