Changeset View
Changeset View
Standalone View
Standalone View
src/bench/ccoins_caching.cpp
Show All 40 Lines | static void CCoinsCaching(benchmark::State &state) { | ||||
t1.vout[0].scriptPubKey << OP_1; | t1.vout[0].scriptPubKey << OP_1; | ||||
// Benchmark. | // Benchmark. | ||||
while (state.KeepRunning()) { | while (state.KeepRunning()) { | ||||
CTransaction t(t1); | CTransaction t(t1); | ||||
bool success = | bool success = | ||||
AreInputsStandard(t, coins, STANDARD_SCRIPT_VERIFY_FLAGS); | AreInputsStandard(t, coins, STANDARD_SCRIPT_VERIFY_FLAGS); | ||||
assert(success); | assert(success); | ||||
Amount value = coins.GetValueIn(t); | |||||
assert(value == (50 + 21 + 22) * COIN); | |||||
} | } | ||||
ECC_Stop(); | ECC_Stop(); | ||||
} | } | ||||
BENCHMARK(CCoinsCaching, 170 * 1000); | BENCHMARK(CCoinsCaching, 170 * 1000); |