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

Function getOutputDistribution1

example/performance.cpp:65–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65std::unordered_map<int64_t, int64_t> getOutputDistribution1(Blockchain &chain, int start, int stop) {
66
67 std::unordered_map<int64_t, int64_t> distribution;
68 for (int height = start; height < stop; height++) {
69 auto block = chain[height];
70 RANGES_FOR(auto tx, block) {
71 RANGES_FOR(auto output, tx.outputs()) {
72 auto value = output.getValue();
73 value &= ~0xFF;
74 auto it = distribution.insert(std::make_pair(value, 0));
75 it.first->second++;
76 }
77 }
78
79 }
80 return distribution;
81}
82
83std::unordered_map<int64_t, int64_t> getOutputDistribution2(Blockchain &chain, int start, int stop) {
84 auto mapFunc = [](const BlockRange &segment) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected