|
|
@ -74,9 +74,9 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates) |
|
|
|
// 9/10 blocks add 2nd highest and so on until ...
|
|
|
|
// 9/10 blocks add 2nd highest and so on until ...
|
|
|
|
// 1/10 blocks add lowest fee/pri transactions
|
|
|
|
// 1/10 blocks add lowest fee/pri transactions
|
|
|
|
while (txHashes[9-h].size()) { |
|
|
|
while (txHashes[9-h].size()) { |
|
|
|
CTransaction btx; |
|
|
|
std::shared_ptr<const CTransaction> ptx = mpool.get(txHashes[9-h].back()); |
|
|
|
if (mpool.lookup(txHashes[9-h].back(), btx)) |
|
|
|
if (ptx) |
|
|
|
block.push_back(btx); |
|
|
|
block.push_back(*ptx); |
|
|
|
txHashes[9-h].pop_back(); |
|
|
|
txHashes[9-h].pop_back(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -160,9 +160,9 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates) |
|
|
|
// Estimates should still not be below original
|
|
|
|
// Estimates should still not be below original
|
|
|
|
for (int j = 0; j < 10; j++) { |
|
|
|
for (int j = 0; j < 10; j++) { |
|
|
|
while(txHashes[j].size()) { |
|
|
|
while(txHashes[j].size()) { |
|
|
|
CTransaction btx; |
|
|
|
std::shared_ptr<const CTransaction> ptx = mpool.get(txHashes[j].back()); |
|
|
|
if (mpool.lookup(txHashes[j].back(), btx)) |
|
|
|
if (ptx) |
|
|
|
block.push_back(btx); |
|
|
|
block.push_back(*ptx); |
|
|
|
txHashes[j].pop_back(); |
|
|
|
txHashes[j].pop_back(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -181,9 +181,9 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates) |
|
|
|
tx.vin[0].prevout.n = 10000*blocknum+100*j+k; |
|
|
|
tx.vin[0].prevout.n = 10000*blocknum+100*j+k; |
|
|
|
uint256 hash = tx.GetHash(); |
|
|
|
uint256 hash = tx.GetHash(); |
|
|
|
mpool.addUnchecked(hash, entry.Fee(feeV[k/4][j]).Time(GetTime()).Priority(priV[k/4][j]).Height(blocknum).FromTx(tx, &mpool)); |
|
|
|
mpool.addUnchecked(hash, entry.Fee(feeV[k/4][j]).Time(GetTime()).Priority(priV[k/4][j]).Height(blocknum).FromTx(tx, &mpool)); |
|
|
|
CTransaction btx; |
|
|
|
std::shared_ptr<const CTransaction> ptx = mpool.get(hash); |
|
|
|
if (mpool.lookup(hash, btx)) |
|
|
|
if (ptx) |
|
|
|
block.push_back(btx); |
|
|
|
block.push_back(*ptx); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
mpool.removeForBlock(block, ++blocknum, dummyConflicted); |
|
|
|
mpool.removeForBlock(block, ++blocknum, dummyConflicted); |
|
|
|