Skip to content

Commit

Permalink
Restore redundant variant types.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jun 27, 2024
1 parent 71bf33a commit 77112a4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
10 changes: 2 additions & 8 deletions include/bitcoin/node/define.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,8 @@ using count_t = size_t;
using height_t = size_t;
using channel_t = uint64_t;
using object_t = object_key;

// HACK: xcode sees header_t unique from uint32_t if defined from links.
// HACK: but clag/gcc/msvc do not, so is a conflict there to add it.
using header_t = uint32_t;
using transaction_t = uint32_t;
static_assert(sizeof(header_t) == sizeof(database::header_link::integer));
static_assert(sizeof(transaction_t) == sizeof(database::tx_link::integer));

using header_t = database::header_link::integer;
using transaction_t = database::tx_link::integer;
typedef system::chain::block::cptr block_t;
////typedef struct
////{
Expand Down
10 changes: 4 additions & 6 deletions include/bitcoin/node/impl/chasers/chaser_organize.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,16 @@ bool CLASS::handle_event(const code&, chase event_, event_value value) NOEXCEPT
case chase::unvalid:
case chase::unconfirmable:
{
// HACK: header_t
// Roll back the candidate chain to confirmed top (via fork point).
BC_ASSERT(std::holds_alternative<uint32_t>(value));
POST(do_disorganize, std::get<uint32_t>(value));
BC_ASSERT(std::holds_alternative<header_t>(value));
POST(do_disorganize, std::get<header_t>(value));
break;
}
case chase::malleated:
{
// HACK: header_t
// Re-obtain the malleated block if it is still a candidate (virtual).
BC_ASSERT(std::holds_alternative<uint32_t>(value));
POST(do_malleated, std::get<uint32_t>(value));
BC_ASSERT(std::holds_alternative<header_t>(value));
POST(do_malleated, std::get<header_t>(value));
break;
}
case chase::stop:
Expand Down
5 changes: 2 additions & 3 deletions src/chasers/chaser_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ bool chaser_check::handle_event(const code&, chase event_,
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
case chase::header:
{
// HACK: header_t
BC_ASSERT(std::holds_alternative<uint32_t>(value));
POST(do_header, std::get<uint32_t>(value));
BC_ASSERT(std::holds_alternative<header_t>(value));
POST(do_header, std::get<header_t>(value));
break;
}
case chase::headers:
Expand Down
5 changes: 2 additions & 3 deletions src/chasers/chaser_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ bool chaser_template::handle_event(const code&, chase event_,
{
case chase::transaction:
{
// HACK: transaction_t
BC_ASSERT(std::holds_alternative<uint32_t>(value));
POST(do_transaction, std::get<uint32_t>(value));
BC_ASSERT(std::holds_alternative<transaction_t>(value));
POST(do_transaction, std::get<transaction_t>(value));
break;
}
case chase::stop:
Expand Down

0 comments on commit 77112a4

Please sign in to comment.