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

Function main

example/example.cpp:30–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28using namespace blocksci;
29
30int main(int argc, const char * argv[]) {
31
32 Blockchain chain(argv[1]);
33
34 int64_t blockCount = 0;
35 int64_t txCount = 0;
36 int64_t inputCount = 0;
37 int64_t outputCount = 0;
38
39 for (auto block : chain) {
40 blockCount += 1;
41 RANGES_FOR(auto tx, block) {
42 txCount += 1;
43 inputCount += tx.inputCount();
44 outputCount += tx.outputCount();
45 }
46 }
47
48 std::cout << "Chain contains:" << std::endl;
49 std::cout << blockCount << " blocks" << std::endl;
50 std::cout << txCount << " transactions" << std::endl;
51 std::cout << inputCount << " inputs" << std::endl;
52 std::cout << outputCount << " outputs" << std::endl;
53
54 return 0;
55}
56

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected