From ba0078e3bf10101329f8cfafe8e34e0e397a32d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc?= Date: Thu, 23 Apr 2026 20:27:48 +0200 Subject: [PATCH] bench: fix ephemeral spend inputs `MempoolCheckEphemeralSpends` wrote every prevout to `tx2.vin[0]` instead of `tx2.vin[i]`. That left only one child input pointing at the parent transaction, while the remaining inputs kept default prevouts. Write each prevout to `vin[i]` instead. Add an assertion that the last child input spends the last parent output. Co-authored-by: David Gumberg --- src/bench/mempool_ephemeral_spends.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bench/mempool_ephemeral_spends.cpp b/src/bench/mempool_ephemeral_spends.cpp index f0d8eb0bea7..1c0692878bd 100644 --- a/src/bench/mempool_ephemeral_spends.cpp +++ b/src/bench/mempool_ephemeral_spends.cpp @@ -59,8 +59,8 @@ static void MempoolCheckEphemeralSpends(benchmark::Bench& bench) CMutableTransaction tx2; tx2.vin.resize(tx1.vout.size()); for (size_t i = 0; i < tx2.vin.size(); i++) { - tx2.vin[0].prevout.hash = parent_txid; - tx2.vin[0].prevout.n = i; + tx2.vin[i].prevout.hash = parent_txid; + tx2.vin[i].prevout.n = i; } tx2.vout.resize(1); @@ -71,6 +71,7 @@ static void MempoolCheckEphemeralSpends(benchmark::Bench& bench) const CTransactionRef tx2_r{MakeTransactionRef(tx2)}; AddTx(tx1_r, pool); + assert(tx2_r->vin.back().prevout == COutPoint(parent_txid, tx1_r->vout.size() - 1)); uint32_t iteration{0};