mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Introduce convenience type CTransactionRef
This commit is contained in:
@@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
||||
CFeeRate baseRate(basefee, GetVirtualTransactionSize(tx));
|
||||
|
||||
// Create a fake block
|
||||
std::vector<std::shared_ptr<const CTransaction>> block;
|
||||
std::vector<CTransactionRef> block;
|
||||
int blocknum = 0;
|
||||
|
||||
// Loop through 200 blocks
|
||||
@@ -66,7 +66,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
||||
// 9/10 blocks add 2nd highest and so on until ...
|
||||
// 1/10 blocks add lowest fee transactions
|
||||
while (txHashes[9-h].size()) {
|
||||
std::shared_ptr<const CTransaction> ptx = mpool.get(txHashes[9-h].back());
|
||||
CTransactionRef ptx = mpool.get(txHashes[9-h].back());
|
||||
if (ptx)
|
||||
block.push_back(ptx);
|
||||
txHashes[9-h].pop_back();
|
||||
@@ -143,7 +143,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
||||
// Estimates should still not be below original
|
||||
for (int j = 0; j < 10; j++) {
|
||||
while(txHashes[j].size()) {
|
||||
std::shared_ptr<const CTransaction> ptx = mpool.get(txHashes[j].back());
|
||||
CTransactionRef ptx = mpool.get(txHashes[j].back());
|
||||
if (ptx)
|
||||
block.push_back(ptx);
|
||||
txHashes[j].pop_back();
|
||||
@@ -163,7 +163,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
||||
tx.vin[0].prevout.n = 10000*blocknum+100*j+k;
|
||||
uint256 hash = tx.GetHash();
|
||||
mpool.addUnchecked(hash, entry.Fee(feeV[j]).Time(GetTime()).Priority(0).Height(blocknum).FromTx(tx, &mpool));
|
||||
std::shared_ptr<const CTransaction> ptx = mpool.get(hash);
|
||||
CTransactionRef ptx = mpool.get(hash);
|
||||
if (ptx)
|
||||
block.push_back(ptx);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user