Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use key parameter name for links used as keys. #506

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading