@@ -403,13 +403,6 @@ void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, setEntries &setAnces
403403
404404 vTxHashes.emplace_back (tx.GetWitnessHash (), newit);
405405 newit->vTxHashesIdx = vTxHashes.size () - 1 ;
406-
407- // ELEMENTS:
408- typedef std::pair<uint256, COutPoint> PeginPair;
409- for (const PeginPair& it : entry.setPeginsSpent ) {
410- std::pair<std::map<std::pair<uint256, COutPoint>, uint256>::iterator, bool > ret = mapPeginsSpentToTxid.insert (std::make_pair (it, tx.GetHash ()));
411- assert (ret.second );
412- }
413406}
414407
415408void CTxMemPool::removeUnchecked (txiter it, MemPoolRemovalReason reason)
@@ -419,12 +412,6 @@ void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason)
419412 for (const CTxIn& txin : it->GetTx ().vin )
420413 mapNextTx.erase (txin.prevout );
421414
422- // ELEMENTS:
423- typedef std::pair<uint256, COutPoint> PeginPair;
424- for (const PeginPair& it2 : it->setPeginsSpent ) {
425- mapPeginsSpentToTxid.erase (it2);
426- }
427-
428415 if (vTxHashes.size () > 1 ) {
429416 vTxHashes[it->vTxHashesIdx ] = std::move (vTxHashes.back ());
430417 vTxHashes[it->vTxHashesIdx ].second ->vTxHashesIdx = it->vTxHashesIdx ;
@@ -561,7 +548,7 @@ void CTxMemPool::removeConflicts(const CTransaction &tx)
561548/* *
562549 * Called when a block is connected. Removes from mempool and updates the miner fee estimator.
563550 */
564- void CTxMemPool::removeForBlock (const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight, const std::set<std::pair<uint256, COutPoint>>& setPeginsSpent, bool pak_transition)
551+ void CTxMemPool::removeForBlock (const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight, bool pak_transition)
565552{
566553 LOCK (cs);
567554 std::vector<const CTxMemPoolEntry*> entries;
@@ -587,22 +574,6 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
587574 ClearPrioritisation (tx->GetHash ());
588575 }
589576
590- // ELEMENTS:
591- // Eject any conflicting pegins
592- for (std::set<std::pair<uint256, COutPoint> >::const_iterator it = setPeginsSpent.begin (); it != setPeginsSpent.end (); it++) {
593- std::map<std::pair<uint256, COutPoint>, uint256>::const_iterator it2 = mapPeginsSpentToTxid.find (*it);
594- if (it2 != mapPeginsSpentToTxid.end ()) {
595- uint256 tx_id = it2->second ;
596- txiter txit = mapTx.find (tx_id);
597- assert (txit != mapTx.end ());
598- const CTransaction& tx = txit->GetTx ();
599- setEntries stage;
600- stage.insert (txit);
601- RemoveStaged (stage, true );
602- removeRecursive (tx, MemPoolRemovalReason::CONFLICT);
603- ClearPrioritisation (tx_id);
604- }
605- }
606577 // Eject any newly-invalid peg-outs based on changing block commitment
607578 const CChainParams& chainparams = Params ();
608579 if (pak_transition && chainparams.GetEnforcePak ()) {
@@ -786,10 +757,6 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
786757 for (std::set<std::pair<uint256, COutPoint> >::const_iterator it = setGlobalPeginsSpent.begin (); it != setGlobalPeginsSpent.end (); it++) {
787758 assert (!pcoins->IsPeginSpent (*it));
788759 }
789- for (std::map<std::pair<uint256, COutPoint>, uint256>::const_iterator it = mapPeginsSpentToTxid.begin (); it != mapPeginsSpentToTxid.end (); it++) {
790- assert (setGlobalPeginsSpent.erase (it->first ));
791- }
792- assert (setGlobalPeginsSpent.size () == 0 );
793760 // END ELEMENTS
794761 //
795762
@@ -988,7 +955,7 @@ bool CCoinsViewMemPool::GetCoin(const COutPoint &outpoint, Coin &coin) const {
988955
989956// ELEMENTS:
990957bool CCoinsViewMemPool::IsPeginSpent (const std::pair<uint256, COutPoint> &outpoint) const {
991- return mempool. mapPeginsSpentToTxid . count (outpoint) || base->IsPeginSpent (outpoint);
958+ return base->IsPeginSpent (outpoint);
992959}
993960
994961size_t CTxMemPool::DynamicMemoryUsage () const {
0 commit comments