mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Make CBlock::vtx a vector of shared_ptr<CTransaction>
This commit is contained in:
@@ -101,7 +101,7 @@ TestChain100Setup::TestChain100Setup() : TestingSetup(CBaseChainParams::REGTEST)
|
||||
{
|
||||
std::vector<CMutableTransaction> noTxns;
|
||||
CBlock b = CreateAndProcessBlock(noTxns, scriptPubKey);
|
||||
coinbaseTxns.push_back(b.vtx[0]);
|
||||
coinbaseTxns.push_back(*b.vtx[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>&
|
||||
// Replace mempool-selected txns with just coinbase plus passed-in txns:
|
||||
block.vtx.resize(1);
|
||||
BOOST_FOREACH(const CMutableTransaction& tx, txns)
|
||||
block.vtx.push_back(tx);
|
||||
block.vtx.push_back(std::make_shared<const CTransaction>(tx));
|
||||
// IncrementExtraNonce creates a valid coinbase and merkleRoot
|
||||
unsigned int extraNonce = 0;
|
||||
IncrementExtraNonce(&block, chainActive.Tip(), extraNonce);
|
||||
@@ -137,12 +137,12 @@ TestChain100Setup::~TestChain100Setup()
|
||||
}
|
||||
|
||||
|
||||
CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(CMutableTransaction &tx, CTxMemPool *pool) {
|
||||
CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CMutableTransaction &tx, CTxMemPool *pool) {
|
||||
CTransaction txn(tx);
|
||||
return FromTx(txn, pool);
|
||||
}
|
||||
|
||||
CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(CTransaction &txn, CTxMemPool *pool) {
|
||||
CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CTransaction &txn, CTxMemPool *pool) {
|
||||
bool hasNoDependencies = pool ? pool->HasNoInputsOf(txn) : hadNoDependencies;
|
||||
// Hack to assume either its completely dependent on other mempool txs or not at all
|
||||
CAmount inChainValue = hasNoDependencies ? txn.GetValueOut() : 0;
|
||||
|
||||
Reference in New Issue
Block a user