Clear mempool before using it for benchmark test, fix parameter name

This commit is contained in:
Jack Grigg 2016-06-29 11:19:41 +12:00
parent f5edc37f3f
commit cfd806e161
1 changed files with 3 additions and 2 deletions

View File

@ -139,7 +139,7 @@ double benchmark_large_tx(bool testValidate)
// with 1 input and N outputs are about the same size as transactions with
// N inputs and 1 output.
mapArgs["-blockmaxsize"] = itostr(MAX_BLOCK_SIZE);
int nBlockSizeRemaining = MAX_BLOCK_SIZE-1000;
int nMaxBlockSize = MAX_BLOCK_SIZE-1000;
std::vector<COutput> vCoins;
pwalletMain->AvailableCoins(vCoins, true);
@ -157,7 +157,7 @@ double benchmark_large_tx(bool testValidate)
// 1a) While the transaction is smaller than the maximum:
CTransaction tx {mtx};
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
while (nTxSize < nBlockSizeRemaining) {
while (nTxSize < nMaxBlockSize) {
// 1b) Add another output
size_t oldSize = mtx.vout.size();
mtx.vout.resize(oldSize+1);
@ -171,6 +171,7 @@ double benchmark_large_tx(bool testValidate)
// 1c) Sign the splitting transaction
SignSignature(*pwalletMain, *vCoins[0].tx, mtx, 0);
uint256 hash = mtx.GetHash();
mempool.clear();
mempool.addUnchecked(hash, CTxMemPoolEntry(mtx, 11, GetTime(), 111.0, 11));
// 2) Mine the splitting transaction into a block