mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
Removed implicit CTransaction conversion from benchmaks
This commit is contained in:
parent
ed61abedb2
commit
8db0c3d42b
@ -35,14 +35,14 @@ SetupDummyInputs(CBasicKeyStore& keystoreRet, CCoinsViewCache& coinsRet)
|
||||
dummyTransactions[0].vout[0].scriptPubKey << ToByteVector(key[0].GetPubKey()) << OP_CHECKSIG;
|
||||
dummyTransactions[0].vout[1].nValue = 50 * COIN;
|
||||
dummyTransactions[0].vout[1].scriptPubKey << ToByteVector(key[1].GetPubKey()) << OP_CHECKSIG;
|
||||
AddCoins(coinsRet, dummyTransactions[0], 0);
|
||||
AddCoins(coinsRet, CTransaction(dummyTransactions[0]), 0);
|
||||
|
||||
dummyTransactions[1].vout.resize(2);
|
||||
dummyTransactions[1].vout[0].nValue = 21 * COIN;
|
||||
dummyTransactions[1].vout[0].scriptPubKey = GetScriptForDestination(key[2].GetPubKey().GetID());
|
||||
dummyTransactions[1].vout[1].nValue = 22 * COIN;
|
||||
dummyTransactions[1].vout[1].scriptPubKey = GetScriptForDestination(key[3].GetPubKey().GetID());
|
||||
AddCoins(coinsRet, dummyTransactions[1], 0);
|
||||
AddCoins(coinsRet, CTransaction(dummyTransactions[1]), 0);
|
||||
|
||||
return dummyTransactions;
|
||||
}
|
||||
@ -76,10 +76,11 @@ static void CCoinsCaching(benchmark::State& state)
|
||||
t1.vout[0].scriptPubKey << OP_1;
|
||||
|
||||
// Benchmark.
|
||||
const CTransaction tx_1(t1);
|
||||
while (state.KeepRunning()) {
|
||||
bool success = AreInputsStandard(t1, coins);
|
||||
bool success = AreInputsStandard(tx_1, coins);
|
||||
assert(success);
|
||||
CAmount value = coins.GetValueIn(t1);
|
||||
CAmount value = coins.GetValueIn(tx_1);
|
||||
assert(value == (50 + 21 + 22) * COIN);
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ static void MempoolEviction(benchmark::State& state)
|
||||
AddTx(tx6_r, 1100LL, pool);
|
||||
AddTx(tx7_r, 9000LL, pool);
|
||||
pool.TrimToSize(pool.DynamicMemoryUsage() * 3 / 4);
|
||||
pool.TrimToSize(GetVirtualTransactionSize(tx1));
|
||||
pool.TrimToSize(GetVirtualTransactionSize(*tx1_r));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user