MCPcopy Create free account
hub / github.com/citp/BlockSci / calculateMaxInputMultithreaded

Function calculateMaxInputMultithreaded

benchmark/main.cpp:181–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181int64_t calculateMaxInputMultithreaded(BlockRange &chain) {
182 auto extract = [&](const Transaction &tx) {
183 int64_t maxValue = 0;
184 for(auto input : tx.inputs()) {
185 maxValue = std::max(input.getValue(), maxValue);
186 }
187 return maxValue;
188 };
189
190 auto combine = [](int64_t &a, int64_t &b) -> int64_t & { a = std::max(a,b); return a; };
191
192 return chain.mapReduce<int64_t>(extract, combine);
193}
194
195int64_t calculateMaxFeeSingleThreaded(BlockRange &chain) {
196 int64_t curMax = 0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected