From b44e0a70d88366e8cd30b848d5ab81356bccb608 Mon Sep 17 00:00:00 2001 From: alex v Date: Sat, 27 Jul 2024 11:39:23 +0200 Subject: [PATCH] check mempool parents --- src/node/miner.cpp | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/node/miner.cpp b/src/node/miner.cpp index ce8c7753e65fc..0dde5bb313ea7 100644 --- a/src/node/miner.cpp +++ b/src/node/miner.cpp @@ -231,29 +231,7 @@ std::unique_ptr BlockAssembler::CreateNewBLSCTBlock(const blsct: addPackageTxs(*m_mempool, nPackagesSelected, nDescendantsUpdated); } - std::set setHashes; - std::set setNoAscendents; - - for (auto& tx : txns) { - setHashes.insert(tx.GetHash()); - } - - for (auto& tx : txns) { - bool fDependsOnOther = false; - for (auto& in : tx.vin) { - if (setHashes.find(in.prevout.hash) != setHashes.end()) { - fDependsOnOther = true; - break; - } - } - if (!fDependsOnOther) - setNoAscendents.insert(tx.GetHash()); - } - for (const CMutableTransaction& tx : txns) { - if (setNoAscendents.find(tx.GetHash()) != setNoAscendents.end()) { - continue; - } for (auto& out : tx.vout) { if (out.scriptPubKey.IsFee()) { nFees += out.nValue; @@ -360,6 +338,7 @@ bool BlockAssembler::TestPackageTransactions(const CTxMemPool::setEntries& packa void BlockAssembler::AddToBlock(CTxMemPool::txiter iter) { + if (iter->GetTx().IsBLSCT() && iter->GetMemPoolParents().size() > 0) return; pblocktemplate->block.vtx.emplace_back(iter->GetSharedTx()); pblocktemplate->vTxFees.push_back(iter->GetFee()); pblocktemplate->vTxSigOpsCost.push_back(iter->GetSigOpCost());