From 78bb10796b5cac68cfd95eca5170d70e514577d2 Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Sun, 11 Oct 2026 21:33:06 -0400 Subject: [PATCH] Set pool arrival time from the clock or block. --- src/chasers/chaser_transaction.cpp | 9 +++++---- test/chasers/chaser_transaction.cpp | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/chasers/chaser_transaction.cpp b/src/chasers/chaser_transaction.cpp index f9e6e708..cc4fccc8 100644 --- a/src/chasers/chaser_transaction.cpp +++ b/src/chasers/chaser_transaction.cpp @@ -144,7 +144,7 @@ void chaser_transaction::do_reorganized(header_t link) NOEXCEPT } // Block txs are already silent indexed. - if (!query.set_pooled(fk, *tx, ctx)) + if (!query.set_pooled(fk, *tx, ctx, ctx.timestamp)) { fault(error::transaction2); return; @@ -216,6 +216,7 @@ void chaser_transaction::do_submit(const transactions_cptr& txs, bool test, } // Parents precede children, so a parent is archived before it is resolved. + const auto time = network::unix_time(); for (index = zero; index < txs->size(); ++index) { if (stored.at(index)) @@ -234,7 +235,7 @@ void chaser_transaction::do_submit(const transactions_cptr& txs, bool test, if (!pooled) { - if (!query.set_pooled(link, tx, pool_)) + if (!query.set_pooled(link, tx, pool_, time)) { handler(fault(error::transaction2), index); return; @@ -368,7 +369,7 @@ code chaser_transaction::fill(database::tx_link& out, if (const auto ec = validate(tx, ctx)) return ec; - if (!query.set_pooled(out, tx, ctx)) + if (!query.set_pooled(out, tx, ctx, ctx.timestamp)) return fault(error::transaction2); if (ctx.height >= query.silent_start_height() && @@ -391,7 +392,7 @@ code chaser_transaction::fill(database::tx_link& out, const auto coinbase = tx.is_coinbase(); if (!pooled && !coinbase) { - if (!query.set_pooled(out, tx, ctx)) + if (!query.set_pooled(out, tx, ctx, ctx.timestamp)) return fault(error::transaction2); if (ctx.height >= query.silent_start_height() && diff --git a/test/chasers/chaser_transaction.cpp b/test/chasers/chaser_transaction.cpp index c4e7d495..17ecdfe1 100644 --- a/test/chasers/chaser_transaction.cpp +++ b/test/chasers/chaser_transaction.cpp @@ -549,6 +549,10 @@ BOOST_FIXTURE_TEST_CASE(chaser_transaction__reorganized__unpooled_block_tx__pool node_.notify(node::error::success, chases::reorganized{ link }); BOOST_REQUIRE(pooled(stored)); BOOST_REQUIRE(!query_.is_pooled(query_.to_tx(coinbase.hash(false)))); + + database::table::pool::record record{}; + BOOST_REQUIRE(store_.pool.get(store_.pool.first(stored), record)); + BOOST_REQUIRE_EQUAL(record.time, header.timestamp()); } // submit_compact