@@ -233,7 +233,7 @@ namespace {
233233 int nPeersWithValidatedDownloads = 0 ;
234234
235235 /* * Relay map, protected by cs_main. */
236- typedef std::map<uint256, std::shared_ptr< const CTransaction> > MapRelay;
236+ typedef std::map<uint256, CTransactionRef > MapRelay;
237237 MapRelay mapRelay;
238238 /* * Expiration-time ordered list of (expire time, relay map entry) pairs, protected by cs_main). */
239239 std::deque<std::pair<int64_t , MapRelay::iterator>> vRelayExpiration;
@@ -1639,7 +1639,7 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, const Consensus::P
16391639
16401640 LOCK (cs_main);
16411641
1642- std::shared_ptr< const CTransaction> ptx = mempool.get (hash);
1642+ CTransactionRef ptx = mempool.get (hash);
16431643 if (ptx)
16441644 {
16451645 txOut = *ptx;
@@ -2845,7 +2845,7 @@ static int64_t nTimePostConnect = 0;
28452845 * Connect a new block to chainActive. pblock is either NULL or a pointer to a CBlock
28462846 * corresponding to pindexNew, to bypass loading it again from disk.
28472847 */
2848- bool static ConnectTip (CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexNew, const CBlock* pblock, std::vector<std::shared_ptr< const CTransaction>> &txConflicted, std::vector<std::tuple<std::shared_ptr< const CTransaction> ,CBlockIndex*,int >> &txChanged)
2848+ bool static ConnectTip (CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexNew, const CBlock* pblock, std::vector<CTransactionRef> &txConflicted, std::vector<std::tuple<CTransactionRef ,CBlockIndex*,int >> &txChanged)
28492849{
28502850 assert (pindexNew->pprev == chainActive.Tip ());
28512851 // Read block from disk.
@@ -2968,7 +2968,7 @@ static void PruneBlockIndexCandidates() {
29682968 * Try to make some progress towards making pindexMostWork the active block.
29692969 * pblock is either NULL or a pointer to a CBlock corresponding to pindexMostWork.
29702970 */
2971- static bool ActivateBestChainStep (CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexMostWork, const CBlock* pblock, bool & fInvalidFound , std::vector<std::shared_ptr< const CTransaction>> & txConflicted, std::vector<std::tuple<std::shared_ptr< const CTransaction> ,CBlockIndex*,int >>& txChanged)
2971+ static bool ActivateBestChainStep (CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexMostWork, const CBlock* pblock, bool & fInvalidFound , std::vector<CTransactionRef> & txConflicted, std::vector<std::tuple<CTransactionRef ,CBlockIndex*,int >>& txChanged)
29722972{
29732973 AssertLockHeld (cs_main);
29742974 const CBlockIndex *pindexOldTip = chainActive.Tip ();
@@ -3069,7 +3069,7 @@ static void NotifyHeaderTip() {
30693069bool ActivateBestChain (CValidationState &state, const CChainParams& chainparams, const CBlock *pblock) {
30703070 CBlockIndex *pindexMostWork = NULL ;
30713071 CBlockIndex *pindexNewTip = NULL ;
3072- std::vector<std::tuple<std::shared_ptr< const CTransaction> ,CBlockIndex*,int >> txChanged;
3072+ std::vector<std::tuple<CTransactionRef ,CBlockIndex*,int >> txChanged;
30733073 if (pblock)
30743074 txChanged.reserve (pblock->vtx .size ());
30753075 do {
@@ -3079,7 +3079,7 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams,
30793079 break ;
30803080
30813081 const CBlockIndex *pindexFork;
3082- std::vector<std::shared_ptr< const CTransaction> > txConflicted;
3082+ std::vector<CTransactionRef > txConflicted;
30833083 bool fInitialDownload ;
30843084 {
30853085 LOCK (cs_main);
@@ -3523,7 +3523,7 @@ void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPr
35233523 tx.wit .vtxinwit .resize (1 );
35243524 tx.wit .vtxinwit [0 ].scriptWitness .stack .resize (1 );
35253525 tx.wit .vtxinwit [0 ].scriptWitness .stack [0 ] = nonce;
3526- block.vtx [0 ] = std::make_shared< const CTransaction> (std::move (tx));
3526+ block.vtx [0 ] = MakeTransactionRef (std::move (tx));
35273527 }
35283528}
35293529
0 commit comments