Skip to content

Commit

Permalink
Merge pull request #506 from evoskuil/master
Browse files Browse the repository at this point in the history
Use key parameter name for links used as keys.
  • Loading branch information
evoskuil committed Jun 28, 2024
2 parents 81e1a31 + dced3da commit 9083a2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions include/bitcoin/database/impl/query/translate.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ header_link CLASS::to_parent(const header_link& link) const NOEXCEPT
}

TEMPLATE
header_link CLASS::to_block(const tx_link& link) const NOEXCEPT
header_link CLASS::to_block(const tx_link& key) const NOEXCEPT
{
table::strong_tx::record strong{};
if (!store_.strong_tx.find(link, strong) || !strong.positive)
if (!store_.strong_tx.find(key, strong) || !strong.positive)
return {};

// Terminal implies not strong (not in block).
Expand All @@ -216,6 +216,8 @@ header_link CLASS::to_block(const tx_link& link) const NOEXCEPT
TEMPLATE
inline strong_pair CLASS::to_strong(const hash_digest& tx_hash) const NOEXCEPT
{
// Iteration of tx is necessary because there may be duplicates.
// Only top block (strong) association for given tx instance is considered.
auto it = store_.tx.it(tx_hash);
strong_pair strong{ {}, it.self() };
if (!it)
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/database/query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class query

/// block/tx to block/s (reverse navigation)
header_link to_parent(const header_link& link) const NOEXCEPT;
header_link to_block(const tx_link& link) const NOEXCEPT;
header_link to_block(const tx_link& key) const NOEXCEPT;

/// output to spenders (reverse navigation)
spend_links to_spenders(const point& prevout) const NOEXCEPT;
Expand Down

0 comments on commit 9083a2d

Please sign in to comment.