|
|
@ -2803,7 +2803,7 @@ static int64_t nTimePostConnect = 0; |
|
|
|
* Connect a new block to chainActive. pblock is either NULL or a pointer to a CBlock |
|
|
|
* Connect a new block to chainActive. pblock is either NULL or a pointer to a CBlock |
|
|
|
* corresponding to pindexNew, to bypass loading it again from disk. |
|
|
|
* corresponding to pindexNew, to bypass loading it again from disk. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
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) |
|
|
|
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<CTransaction,CBlockIndex*,int>> &txChanged) |
|
|
|
{ |
|
|
|
{ |
|
|
|
assert(pindexNew->pprev == chainActive.Tip()); |
|
|
|
assert(pindexNew->pprev == chainActive.Tip()); |
|
|
|
// Read block from disk.
|
|
|
|
// Read block from disk.
|
|
|
@ -2926,7 +2926,7 @@ static void PruneBlockIndexCandidates() { |
|
|
|
* Try to make some progress towards making pindexMostWork the active block. |
|
|
|
* Try to make some progress towards making pindexMostWork the active block. |
|
|
|
* pblock is either NULL or a pointer to a CBlock corresponding to pindexMostWork. |
|
|
|
* pblock is either NULL or a pointer to a CBlock corresponding to pindexMostWork. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
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) |
|
|
|
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<CTransaction,CBlockIndex*,int>>& txChanged) |
|
|
|
{ |
|
|
|
{ |
|
|
|
AssertLockHeld(cs_main); |
|
|
|
AssertLockHeld(cs_main); |
|
|
|
const CBlockIndex *pindexOldTip = chainActive.Tip(); |
|
|
|
const CBlockIndex *pindexOldTip = chainActive.Tip(); |
|
|
@ -3037,7 +3037,7 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams, |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
const CBlockIndex *pindexFork; |
|
|
|
const CBlockIndex *pindexFork; |
|
|
|
std::list<CTransaction> txConflicted; |
|
|
|
std::vector<std::shared_ptr<const CTransaction>> txConflicted; |
|
|
|
bool fInitialDownload; |
|
|
|
bool fInitialDownload; |
|
|
|
{ |
|
|
|
{ |
|
|
|
LOCK(cs_main); |
|
|
|
LOCK(cs_main); |
|
|
@ -3068,9 +3068,9 @@ bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams, |
|
|
|
|
|
|
|
|
|
|
|
// throw all transactions though the signal-interface
|
|
|
|
// throw all transactions though the signal-interface
|
|
|
|
// while _not_ holding the cs_main lock
|
|
|
|
// while _not_ holding the cs_main lock
|
|
|
|
BOOST_FOREACH(const CTransaction &tx, txConflicted) |
|
|
|
for(std::shared_ptr<const CTransaction> tx : txConflicted) |
|
|
|
{ |
|
|
|
{ |
|
|
|
GetMainSignals().SyncTransaction(tx, pindexNewTip, CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK); |
|
|
|
GetMainSignals().SyncTransaction(*tx, pindexNewTip, CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK); |
|
|
|
} |
|
|
|
} |
|
|
|
// ... and about transactions that got confirmed:
|
|
|
|
// ... and about transactions that got confirmed:
|
|
|
|
for(unsigned int i = 0; i < txChanged.size(); i++) |
|
|
|
for(unsigned int i = 0; i < txChanged.size(); i++) |
|
|
|