From e20c8d0b22ad3c7c80844c549a324e088b7dfe36 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Tue, 15 Oct 2024 11:51:19 -0400 Subject: [PATCH] Return error::txs_empty for block_confirmable() with no txs. --- include/bitcoin/database/impl/query/confirm.ipp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/bitcoin/database/impl/query/confirm.ipp b/include/bitcoin/database/impl/query/confirm.ipp index 9a778bd8..7649ead3 100644 --- a/include/bitcoin/database/impl/query/confirm.ipp +++ b/include/bitcoin/database/impl/query/confirm.ipp @@ -383,7 +383,7 @@ code CLASS::tx_confirmable(const tx_link& link, return error::success; } -// Used by node for sequential by block (unsed). +// Used by node for sequential by block (unused). // split(0) 403 secs for 400k-410k TEMPLATE code CLASS::block_confirmable(const header_link& link) const NOEXCEPT @@ -392,11 +392,11 @@ code CLASS::block_confirmable(const header_link& link) const NOEXCEPT if (!get_context(ctx, link)) return error::integrity; - code ec{}; const auto txs = to_transactions(link); if (txs.empty()) - return ec; + return error::txs_empty; + code ec{}; if ((ec = unspent_duplicates(txs.front(), ctx))) return ec;