Skip to content

Commit 0baae08

Browse files
committed
fixup mempool clearing of peg-outs on block commitment
1 parent 009d0b9 commit 0baae08

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/txmempool.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,18 +614,18 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
614614
}
615615
// Eject any newly-invalid peg-outs based on changing block commitment
616616
const CChainParams& chainparams = Params();
617-
if (pak_transition && !gArgs.GetBoolArg("-acceptnonstdtxn", !chainparams.RequireStandard())) {
617+
if (pak_transition && chainparams.GetEnforcePak()) {
618618
for (const auto& entry : mapTx) {
619619
for (const auto& out : entry.GetTx().vout) {
620620
if (out.scriptPubKey.IsPegoutScript(Params().ParentGenesisBlockHash()) &&
621621
!ScriptHasValidPAKProof(out.scriptPubKey, Params().ParentGenesisBlockHash())) {
622-
txiter it = mapTx.find(entry.GetTx().GetHash());
622+
const uint256 tx_id = entry.GetTx().GetHash();
623+
txiter it = mapTx.find(tx_id);
623624
const CTransaction& tx = it->GetTx();
624625
setEntries stage;
625626
stage.insert(it);
626-
RemoveStaged(stage, true, MemPoolRemovalReason::BLOCK);
627627
removeRecursive(tx, MemPoolRemovalReason::BLOCK);
628-
ClearPrioritisation(tx.GetHash());
628+
ClearPrioritisation(tx_id);
629629
break;
630630
}
631631
}

0 commit comments

Comments
 (0)