@@ -2793,7 +2793,7 @@ static int64_t nTimePostConnect = 0;
2793
2793
* Connect a new block to chainActive. pblock is either NULL or a pointer to a CBlock
2794
2794
* corresponding to pindexNew, to bypass loading it again from disk.
2795
2795
*/
2796
- bool static ConnectTip (CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexNew, const CBlock* pblock, std::list<CTransaction> &txConflicted, std::vector<std::tuple<CTransaction,CBlockIndex*,int > > &txChanged)
2796
+ bool static ConnectTip (CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexNew, const CBlock* pblock, std::list<CTransaction> &txConflicted, std::vector<std::tuple<CTransaction,CBlockIndex*,int >> &txChanged)
2797
2797
{
2798
2798
assert (pindexNew->pprev == chainActive.Tip ());
2799
2799
// Read block from disk.
@@ -2835,7 +2835,7 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
2835
2835
UpdateTip (pindexNew, chainparams);
2836
2836
2837
2837
for (unsigned int i=0 ; i < pblock->vtx .size (); i++)
2838
- txChanged.push_back ( std::make_tuple ( pblock->vtx [i], pindexNew, i) );
2838
+ txChanged.emplace_back ( pblock->vtx [i], pindexNew, i);
2839
2839
2840
2840
int64_t nTime6 = GetTimeMicros (); nTimePostConnect += nTime6 - nTime5; nTimeTotal += nTime6 - nTime1;
2841
2841
LogPrint (" bench" , " - Connect postprocess: %.2fms [%.2fs]\n " , (nTime6 - nTime5) * 0.001 , nTimePostConnect * 0.000001 );
@@ -2917,7 +2917,7 @@ static void PruneBlockIndexCandidates() {
2917
2917
* Try to make some progress towards making pindexMostWork the active block.
2918
2918
* pblock is either NULL or a pointer to a CBlock corresponding to pindexMostWork.
2919
2919
*/
2920
- static bool ActivateBestChainStep (CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexMostWork, const CBlock* pblock, bool & fInvalidFound , std::list<CTransaction>& txConflicted, std::vector<std::tuple<CTransaction,CBlockIndex*,int > >& txChanged)
2920
+ static bool ActivateBestChainStep (CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexMostWork, const CBlock* pblock, bool & fInvalidFound , std::list<CTransaction>& txConflicted, std::vector<std::tuple<CTransaction,CBlockIndex*,int >>& txChanged)
2921
2921
{
2922
2922
AssertLockHeld (cs_main);
2923
2923
const CBlockIndex *pindexOldTip = chainActive.Tip ();
@@ -3019,14 +3019,17 @@ static void NotifyHeaderTip() {
3019
3019
bool ActivateBestChain (CValidationState &state, const CChainParams& chainparams, const CBlock *pblock) {
3020
3020
CBlockIndex *pindexMostWork = NULL ;
3021
3021
CBlockIndex *pindexNewTip = NULL ;
3022
+ std::vector<std::tuple<CTransaction,CBlockIndex*,int >> txChanged;
3023
+ if (pblock)
3024
+ txChanged.reserve (pblock->vtx .size ());
3022
3025
do {
3026
+ txChanged.clear ();
3023
3027
boost::this_thread::interruption_point ();
3024
3028
if (ShutdownRequested ())
3025
3029
break ;
3026
3030
3027
3031
const CBlockIndex *pindexFork;
3028
3032
std::list<CTransaction> txConflicted;
3029
- std::vector<std::tuple<CTransaction,CBlockIndex*,int > > txChanged;
3030
3033
bool fInitialDownload ;
3031
3034
int nNewHeight;
3032
3035
{
0 commit comments