| 123 | } |
| 124 | |
| 125 | int64_t maxValOutput2(Blockchain &chain, int start, int stop) { |
| 126 | auto extract = [](const Transaction &tx) { |
| 127 | int64_t maxValue = 0; |
| 128 | for(auto output : tx.outputs()) { |
| 129 | maxValue = std::max(output.getValue(), maxValue); |
| 130 | } |
| 131 | return maxValue; |
| 132 | }; |
| 133 | |
| 134 | auto combine = [](int64_t &a, int64_t &b) -> int64_t & { a = std::max(a,b); return a; }; |
| 135 | |
| 136 | return chain[{start, stop}].mapReduce<int64_t>(extract, combine); |
| 137 | } |
nothing calls this directly
no outgoing calls
no test coverage detected