Skip to content

Commit c59ab50

Browse files
committed
Add to_confirmed(tx_hash), stub to_confirmed_spender(point).
1 parent 71bd5a8 commit c59ab50

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

include/bitcoin/database/impl/query/translate.ipp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ header_link CLASS::to_strong(const hash_digest& tx_hash) const NOEXCEPT
196196

197197
return {};
198198
}
199-
200199
TEMPLATE
201200
header_link CLASS::to_parent(const header_link& link) const NOEXCEPT
202201
{
@@ -208,6 +207,27 @@ header_link CLASS::to_parent(const header_link& link) const NOEXCEPT
208207
return header.parent_fk;
209208
}
210209

210+
// to confirmed objects (reverse navigation)
211+
// ----------------------------------------------------------------------------
212+
213+
TEMPLATE
214+
header_link CLASS::to_confirmed_block(
215+
const hash_digest& tx_hash) const NOEXCEPT
216+
{
217+
const auto block = to_strong(tx_hash);
218+
if (!is_confirmed_block(block))
219+
return {};
220+
221+
return block;
222+
}
223+
224+
TEMPLATE
225+
point_link CLASS::to_confirmed_spender(const point&) const NOEXCEPT
226+
{
227+
// TODO: implement.
228+
return {};
229+
}
230+
211231
// output to spenders (reverse navigation)
212232
// ----------------------------------------------------------------------------
213233

include/bitcoin/database/query.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ class query
291291
header_link to_strong(const hash_digest& tx_hash) const NOEXCEPT;
292292
header_link to_parent(const header_link& link) const NOEXCEPT;
293293

294+
/// to confirmed objects (reverse navigation)
295+
header_link to_confirmed_block(const hash_digest& tx_hash) const NOEXCEPT;
296+
point_link to_confirmed_spender(const point& prevout) const NOEXCEPT;
297+
294298
/// output to spenders (reverse navigation)
295299
point_links to_spenders(const point& prevout) const NOEXCEPT;
296300
point_links to_spenders(const output_link& link) const NOEXCEPT;

0 commit comments

Comments
 (0)