[refactor] TxOrphanage::EraseTx by wtxid

No behavior change right now, as transactions in the orphanage are
unique by txid. This makes the next commit easier to review.
This commit is contained in:
glozow
2024-05-10 12:04:50 +01:00
parent efcc593017
commit c31f148166
4 changed files with 22 additions and 20 deletions

View File

@@ -137,12 +137,12 @@ FUZZ_TARGET(txorphan, .init = initialize_orphanage)
bool have_tx = orphanage.HaveTx(tx->GetWitnessHash());
// EraseTx should return 0 if m_orphans doesn't have the tx
{
Assert(have_tx == orphanage.EraseTx(tx->GetHash()));
Assert(have_tx == orphanage.EraseTx(tx->GetWitnessHash()));
}
have_tx = orphanage.HaveTx(tx->GetWitnessHash());
// have_tx should be false and EraseTx should fail
{
Assert(!have_tx && !orphanage.EraseTx(tx->GetHash()));
Assert(!have_tx && !orphanage.EraseTx(tx->GetWitnessHash()));
}
},
[&] {